IN Android i can authenticate perfectly with signInWithPhoneNumber but in ios i have this issue
NativeFirebaseError: [auth/notification-not-forwarded] If app delegate swizzling is disabled, remote notifications received by UIApplicationDelegate need to be forwarded to FIRAuth's canHandleNotificaton: method.
at FirebaseAuthModule.signInWithPhoneNumber (http://192.168.0.167:8081/index.bundle?platform=ios&dev=true&minify=false:107323:28)
Environment:
Hi @codifius,
I had the same problem. To fix this issue I added the following to the AppDelegate.m file. No further research done if this is the right way or what implications this could cause. Just needed to unblock this issue to continue the development for now.
- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
// I used type:FIRAuthAPNSTokenTypeSandbox as the entitlement is set to development
[[FIRAuth auth] setAPNSToken:deviceToken type:FIRAuthAPNSTokenTypeSandbox];
}
- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)notification
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
if ([[FIRAuth auth] canHandleNotification:notification]) {
completionHandler(UIBackgroundFetchResultNoData);
return;
}
}
Hope this helps.
I did some tests and this problem happens since 6.4.0-rc1.
Still getting it in 6.4.0.
I am getting the same error after upgrading to 6.4.0
@kschio your solution works very well and I have no bug in the sending notifications after the insertion of your code.
Thanks a lot :)
Hi,
did you change the type for the production release from "FIRAuthAPNSTokenTypeSandbox" to "FIRAuthAPNSTokenTypeProd"? Also make sure that the entitlements file has the right value (production) for the "APS Environment".
I successfully built multiple Test Flight and Production releases without any problems.
On Wednesday, Apr 08, 2020 at 12:46 AM, Mateus Miranda
@kschio (https://github.com/kschio)
when generating a release, this code does not work, is there another solution? need help—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (https://github.com/invertase/react-native-firebase/issues/3386#issuecomment-610657061), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AALCNECKL5G5GNL4S3C4YODRLOUNNANCNFSM4LZLEYDA).
- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
#if DEBUG
[[FIRAuth auth] setAPNSToken:deviceToken type:FIRAuthAPNSTokenTypeSandbox];
#else
[[FIRAuth auth] setAPNSToken:deviceToken type:FIRAuthAPNSTokenTypeProd];
#endif
}
@kschio the fix solved it for me. Could you explain how did you come up with this solution? Did you find it somewhere in the docs?
@tautvilas I'm glad it helped! I went through all the official Firebase documentation and took bits and piece from there and put it together.
Are there plans to merge the fix for this? The bug is breaking the most critical part of our app (user sign in). This issue makes migration from v5 to v6 not possible.
Anything update?
latest release 6.7.1 works for me.
Hi @kschio, for production release, did you get APP_NAME in SMS? I got SMS in production release but without APP_NAME. (App already in App Store)🤷🏼♂️
Edited: It takes about a week for APP_NAME to appear.
latest release 6.7.1 works for me.
Did not do it for me. I had to add @kschio s code...
Hello 👋, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
This issue still exists in version 8.2.0. Is there a fix in the pipeline or an open PR that addresses this issue?
@dhee9000 I see nothing linked her nor any discussion. If you search PRs and issues and find nothing either, then nope - needs an interested party to roll up their sleeves and figure out what the deal is. If the deal is just as described above and the workaround above works, then if someone could open a PR that would get it in the pipeline
I couldn't find any other issues or PRs related to this so I will go ahead and open up a PR with the workaround above.
Hello 👋, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.
Most helpful comment
Hi @codifius,
I had the same problem. To fix this issue I added the following to the
AppDelegate.mfile. No further research done if this is the right way or what implications this could cause. Just needed to unblock this issue to continue the development for now.Hope this helps.