Skip to content

Commit f3b49e3

Browse files
committed
Added the call to registerForRemoteNotifications in init if AutoPrompt set to @no.
1 parent 19a14b0 commit f3b49e3

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed
4.05 KB
Binary file not shown.
4.03 KB
Binary file not shown.

iOS_SDK/OneSignal/OneSignal.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ + (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId
183183
if (autoPrompt || registeredWithApple)
184184
[self registerForPushNotifications];
185185

186+
// iOS 8 - Register for remote notifications to get a token now since registerUserNotificationSettings is what shows the prompt.
187+
// If autoprompt disabled, get a token from APNS for silent notifications until user calls regsiterForPushNotifications to request push permissions from user.
188+
else if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerForRemoteNotifications)])
189+
[[UIApplication sharedApplication] registerForRemoteNotifications];
190+
186191
[OneSignalTracker onFocus:NO];
187192
}
188193

0 commit comments

Comments
 (0)