React native firebase signInWithPhoneNumber Error after integrate the FCM on iOS

58 Views Asked by At

I'm facing with below error when call the auth().signInWithPhoneNumber(phoneNumber); after integrate with firebase FCM - on iOS only (Android works fine). Everything worked fine before I integrate with FCM.

Error: [auth/notification-not-forwarded] If app delegate swizzling is disabled, remote notifications received by UIApplicationDelegate need to be forwarded to FIRAuth's canHandleNotificaton: method.

I tried to update the file RNFBMessaging+AppDelegate.m as the guide in this guide to add FIRAuthAPNSTokenTypeSandbox but I can't build app:

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { #if DEBUG [[FIRAuth auth] setAPNSToken:deviceToken type:FIRAuthAPNSTokenTypeSandbox]; #else [[FIRAuth auth] setAPNSToken:deviceToken type:FIRAuthAPNSTokenTypeProd]; #endif }
  • I have tested on simulator and on real device (Test Flight), and can't receive auth SMS.
  • React Native version: 0.70.0
  • rnfirebase-app/auth/messaging version: 18.5.0

Can anyone help to resolve this problem! Thank you!

0

There are 0 best solutions below