Skip to content

Commit cc90c00

Browse files
committed
Always immediately register once we get an APNs token
Previously we would wait for the notification permission prompt to be completed before we registered the user. This is not a correct optimization so we are removing that behavior.
1 parent c98b1f8 commit cc90c00

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

iOS_SDK/OneSignalSDK/Source/OneSignal.m

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,18 +1631,10 @@ + (void)updateDeviceToken:(NSString*)deviceToken {
16311631
let isPushTokenDifferent = ![deviceToken isEqualToString:self.currentSubscriptionState.pushToken];
16321632
self.currentSubscriptionState.pushToken = deviceToken;
16331633

1634-
// iOS 9+ - We get a token right away but give the user 30 sec to respond notification permission prompt.
1635-
// The goal is to only have 1 server call.
1636-
[self.osNotificationSettings getNotificationPermissionState:^(OSPermissionState *status) {
1637-
if (status.answeredPrompt || status.provisional) {
1638-
if ([self shouldRegisterNow])
1639-
[self registerUser];
1640-
else if (isPushTokenDifferent)
1641-
[self playerPutForPushTokenAndNotificationTypes];
1642-
} else {
1643-
[self registerUserAfterDelay];
1644-
}
1645-
}];
1634+
if ([self shouldRegisterNow])
1635+
[self registerUser];
1636+
else if (isPushTokenDifferent)
1637+
[self playerPutForPushTokenAndNotificationTypes];
16461638
}
16471639

16481640
+ (void)playerPutForPushTokenAndNotificationTypes {

0 commit comments

Comments
 (0)