0

I am working on a React Native webview app for a Ruby on Rails website. I added Push Notifications using Firebase Cloud Messaging. My colleague integrated the Google Calendar API into the RoR website, and it works fine when on the website. But, when trying to sign in to google in the webview app, I'm getting this error.

I tried putting the objective c code of this solution into my AppDelegate.m, and it prompted me to enter my gmail, but then gave this different error.

I then tried putting the objective c code of this solution into my AppDelegate.m, and it allowed me to sign into google properly. However, it broke my Firebase Push Notifications, so that now it will not ask the user for push notification permission.

Has anyone had a similar issue and know of a solution or ideas? Is there a good solution that allows a webview app to sign into google and use firebase push notifications?

Christian Doucette
  • 1,104
  • 3
  • 12
  • 21

1 Answers1

0

Just Make sure you have following things added in your AppDeligate.m file as well

import statement

@import Firebase;


-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

inside above method add

[FIRApp configure];

and if the notifications are in-app notifications please add these two lines aswell to the same method

UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
  center.delegate = self;

once these things are done try re-running the project hope this works!!!

Pratik Mittal
  • 163
  • 2
  • 7
  • Hmm, I already have ```#import ``` and ```if ([FIRApp defaultApp] == nil) { [FIRApp configure]; }``` in the AppDelegate.m, and I'm not using in-app notifications. In fact, the firebase notifications were working correctly up until I added [this](https://stackoverflow.com/a/43270724/14056167) to my AppDelegate.m to try to fix the google sign in. – Christian Doucette Aug 14 '20 at 13:11