You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cannot disable autoRegister. Passing false to autoRegister in initWithLaunchOptions does not help and still triggers automatic registration. I need to delay the registration.
I'm using 1.9.0 version.
I just tested version 1.9.0 with autoRegister: false and it working correctly. Which version of iOS are you seeing this issue on?
How are you resetting the push notification prompt? If your turning off the device when you see the prompt you will need to fully uninstall the app and reinstall it before opening it again. Otherwise iOS will reprompt the user right way when the app opens.
I just tested version 1.9.0 with autoRegister: false and it working
correctly. Which version of iOS are you seeing this issue on?
How are you resetting the push notification prompt? If your turning off
the device when you see the prompt you will need to fully uninstall the app
and reinstall it before opening it again. Otherwise iOS will reprompt the
user right way when the app opens.
Hello, sorry about the delay. I identified an issue where our SDK prompts for push notifications on the 2nd cold start of the app. This seems to be an issue on iOS 8+ devices. I'll attach a commit to this issue when I have a fix.
Hello, sorry about the delay. I identified an issue where our SDK prompts
for push notifications on the 2nd cold start of the app. I'll attach a
commit to this issue when I have a fix.
Thanks.
—
Reply to this email directly or view it on GitHub #1 (comment)
.
didRegisterForRemoteNotificationsWithDeviceToken is being called when I init OneSignal on the app launch. Maybe it's an iOS9 issue.
Instead, I'm deferring OneSignal init with autoRegister set to True at a later stage in the app. Seems to work.
Are you seeing the iOS notification permission prompt when OneSignal initWithLaunchOptions is called with autoRegister: false? Or just seeing the firing of application:didRegisterForRemoteNotificationsWithDeviceToken:?
I have tested 1.9.2 of our OneSignal SDK with iOS 8.2 and iOS 9 beta 2 and autoRegister: false does not prompt the user for the notification permissions.
The UIApplicationDelegateapplication:didRegisterForRemoteNotificationsWithDeviceToken: selector is always fired from the OneSignal initWithLaunchOptions: selectors as it always calls [[UIApplication sharedApplication] registerForRemoteNotifications] on iOS 8+ devices. This is ok as it does not prompt the user for notification permissions. The call to registerUserNotificationSettings: inside of OneSignal's registerForPushNotifications selector does the prompting. The autoRegister could be better named as autoPrompt but this was named this way before iOS 8 was released.
If you defer OneSignal init the notification opened callback, session count, total playtime, IAP tracking, as well as any other selector that requires a OneSignal instance will not work.
I'm seeing the firing of application:didRegisterForRemoteNotificationsWithDeviceToken without prompt. So I understand this is a desired behaviour.
I defer OneSignal init, only the first time, until the user is prompted at a specific point in the app. In the successive app launches, OneSignal inits on launch. It this OK?
Correct, the firing of application:didRegisterForRemoteNotificationsWithDeviceToken when your app starts is by design. It shouldn't create an issue, do you have another SDK/plugin this is creating a problem with?
We would prefer to understand and fix the issue however if you need to go this route with your app you will need to wrap any other method calls to OneSignal with your same logic. We did not intend for OneSignal not be called when your app starts. You also won't be able to see your user opt in rate on our dashboard and anything the user does before accepting will not be included in their totals.
Josh, we have some logic in application:didRegisterForRemoteNotificationsWithDeviceToken with another functionality.
How is application:didRegisterForRemoteNotificationsWithDeviceToken fired without user prompt in the first run? Is the deviceToken in such case is nil?
In iOS 8 Apple split up push notifications into 2 parts.
Remote notifications - You can get a valid device token without permission from the user and it can be used for content-available notifications. It can not however display a notification, play a sound, or set a badge icon without prompting the user. This id is requested with registerForRemoteNotifications and fires application:didRegisterForRemoteNotificationsWithDeviceToken:.
Displaying Notifications - To display notifications and set badges (locally or remotely) requires the user to accept a notification permissions prompt. This is requested by calling registerUserNotificationSettings:.
If you only want to get the deviceToken/pushPush token if the user accepted permissions to display notifications you can use OneSignal's IdsAvailable: selector. pushToken will be nil if the user has not accepted the prompt yet or disabled notifications in the system settings for your app.
Activity
jkasten2 commentedon Jun 17, 2015
Hello,
I just tested version 1.9.0 with autoRegister: false and it working correctly. Which version of iOS are you seeing this issue on?
How are you resetting the push notification prompt? If your turning off the device when you see the prompt you will need to fully uninstall the app and reinstall it before opening it again. Otherwise iOS will reprompt the user right way when the app opens.
See our documentation on Resetting the iOS Notification Permission Prompt.
Thanks.
stasix commentedon Jun 18, 2015
Hi, thanks for the quick prompt.
I'm seeing this on iOS9.
On Thursday, June 18, 2015, Josh Kasten notifications@github.com wrote:
Stas Goferman
CEO, Bazaart http://www.bazaart.me/
jkasten2 commentedon Jun 22, 2015
Hello, sorry about the delay. I identified an issue where our SDK prompts for push notifications on the 2nd cold start of the app. This seems to be an issue on iOS 8+ devices. I'll attach a commit to this issue when I have a fix.
Thanks.
stasix commentedon Jun 22, 2015
Great! Thanks!
Stas Goferman
CEO, Bazaart http://www.bazaart.me/
On Tue, Jun 23, 2015 at 12:33 AM, Josh Kasten notifications@github.com
wrote:
Fixed issue #1 with autoRegister
stasix commentedon Jun 23, 2015
@jkasten2, can you update the pod as well to 1.9.2?
jkasten2 commentedon Jun 23, 2015
Just pushed our update to cocoa pods. Let us know if this version fixes the issue for you and we can close this issue.
Thanks.
stasix commentedon Jun 25, 2015
didRegisterForRemoteNotificationsWithDeviceToken is being called when I init OneSignal on the app launch. Maybe it's an iOS9 issue.
Instead, I'm deferring OneSignal init with autoRegister set to True at a later stage in the app. Seems to work.
jkasten2 commentedon Jun 26, 2015
Are you seeing the iOS notification permission prompt when OneSignal initWithLaunchOptions is called with autoRegister: false? Or just seeing the firing of
application:didRegisterForRemoteNotificationsWithDeviceToken:?I have tested 1.9.2 of our OneSignal SDK with iOS 8.2 and iOS 9 beta 2 and autoRegister: false does not prompt the user for the notification permissions.
The
UIApplicationDelegateapplication:didRegisterForRemoteNotificationsWithDeviceToken:selector is always fired from the OneSignalinitWithLaunchOptions:selectors as it always calls[[UIApplication sharedApplication] registerForRemoteNotifications]on iOS 8+ devices. This is ok as it does not prompt the user for notification permissions. The call toregisterUserNotificationSettings:inside of OneSignal'sregisterForPushNotificationsselector does the prompting. TheautoRegistercould be better named as autoPrompt but this was named this way before iOS 8 was released.If you defer OneSignal init the notification opened callback, session count, total playtime, IAP tracking, as well as any other selector that requires a OneSignal instance will not work.
Thanks.
stasix commentedon Jun 28, 2015
I'm seeing the firing of application:didRegisterForRemoteNotificationsWithDeviceToken without prompt. So I understand this is a desired behaviour.
I defer OneSignal init, only the first time, until the user is prompted at a specific point in the app. In the successive app launches, OneSignal inits on launch. It this OK?
jkasten2 commentedon Jun 29, 2015
Correct, the firing of
application:didRegisterForRemoteNotificationsWithDeviceTokenwhen your app starts is by design. It shouldn't create an issue, do you have another SDK/plugin this is creating a problem with?We would prefer to understand and fix the issue however if you need to go this route with your app you will need to wrap any other method calls to OneSignal with your same logic. We did not intend for OneSignal not be called when your app starts. You also won't be able to see your user opt in rate on our dashboard and anything the user does before accepting will not be included in their totals.
Thanks.
stasix commentedon Jul 9, 2015
Josh, we have some logic in application:didRegisterForRemoteNotificationsWithDeviceToken with another functionality.
How is application:didRegisterForRemoteNotificationsWithDeviceToken fired without user prompt in the first run? Is the deviceToken in such case is nil?
jkasten2 commentedon Jul 9, 2015
In iOS 8 Apple split up push notifications into 2 parts.
See the documentation on registerForRemoteNotifications for the source of what I explained above.
If you only want to get the deviceToken/pushPush token if the user accepted permissions to display notifications you can use OneSignal's IdsAvailable: selector. pushToken will be nil if the user has not accepted the prompt yet or disabled notifications in the system settings for your app.
Thanks.
stasix commentedon Jul 10, 2015
@jkasten2 - Thanks for clarifying this and for your time. This makes a lot sense now.
btw, we love OneSignal!
Merge pull request #1 from iAugux/fix/dialog-issue