Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions Libraries/PushNotificationIOS/RCTPushNotificationManager.m
Original file line numberDiff line numberDiff line change
Expand Up@@ -142,6 +142,15 @@ - (void)startObserving
selector:@selector(handleRemoteNotificationReceived:)
name:RCTRemoteNotificationReceived
object:nil];
[self startObservingRegistrationNotifications];
}

- (void)startObservingRegistrationNotifications
{
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleRegisterUserNotificationSettings:)
name:RCTRegisterUserNotificationSettings
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleRemoteNotificationsRegistered:)
name:RCTRemoteNotificationsRegistered
Expand All@@ -150,10 +159,6 @@ - (void)startObserving
selector:@selector(handleRemoteNotificationRegistrationError:)
name:RCTErrorRemoteNotificationRegistrationFailed
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleRegisterUserNotificationSettings:)
name:RCTRegisterUserNotificationSettings
object:nil];
}

- (void)stopObserving
Expand DownExpand Up@@ -319,6 +324,7 @@ - (void)handleRegisterUserNotificationSettings:(NSNotification *)notification
return;
}

[self startObservingRegistrationNotifications];
_requestPermissionsResolveBlock = resolve;

UIUserNotificationType types = UIUserNotificationTypeNone;
Expand Down