Closed
Description
I've been following #2332 and am glad that it looks like it will be in, but I still think there is an issue. I'm running iOS 8+
I'm seeing the push registration callback twice.
My appdelegate looks like this...
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
[RCTPushNotificationManager application:application didRegisterUserNotificationSettings:notificationSettings];
}
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
[RCTPushNotificationManager application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)notification
{
[RCTPushNotificationManager application:application didReceiveRemoteNotification:notification];
}
The JS code ends up calling requestPermissions
(RCTPushNotificationManager.m) which does
[[UIApplication sharedApplication] registerUserNotificationSettings:notificationSettings];
[[UIApplication sharedApplication] registerForRemoteNotifications];
Then there is the appdelgate callback to didRegisterUserNotificationSettings and then didRegisterForRemoteNotificationsWithDeviceToken
(both)
The first one calls back into RCTPushNotificationManager, which does this.
+ (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(__unused UIUserNotificationSettings *)notificationSettings
{
[application registerForRemoteNotifications];
}
You'll note there is a second call to registerForRemoteNotifications
My iOS guy says he would remove the call to registerForRemoteNotifications
in requestPermissions
Anyone else seeing this?