Onesignal-ios-sdk: Disabling kOSSettingsKeyAutoPrompt is always firing registration

Created on 11 Oct 2016  ·  8Comments  ·  Source: OneSignal/OneSignal-iOS-SDK

Hi, i want to trigger the prompt by myself and not after the startup and if i set kOSSettingsKeyAutoPrompt to false. The promt will come again :/

any ideas?

//One Signal Settings
NSDictionary * settings = @{kOSSettingsKeyAutoPrompt : @false};
[OneSignal initWithLaunchOptions:launchOptions appId:ONE_SIGNAL_APP_ID handleNotificationAction:nil settings:settings];

Most helpful comment

This one should be reopened, since I'm still having this behavior. I'm passing settings: [kOSSettingsKeyAutoPrompt: false], but alert still shows up.

All 8 comments

Hi @appcelerate,

Setting kOSSettingsKeyAutoPrompt : @NO will prevent our SDK from requesting push _alert_ permissions from the user. However the SDK will still fetch a device token useful for silent notifications as your app has the _remote notification_ background mode.

Let me know if that works for you.

Hi @JKalash,

kOSSettingsKeyAutoPrompt : @NO don't prevent on my side the user to getting the push alert.
Always get it in the first session after startup :/

Same here. I've set the kOSSettingsKeyAutoPrompt to false (Swift) and it still shows on startup.

mine is worked with settings: [kOSSettingsKeyAutoPrompt: false]

How is this resolved? I have the same behavior.

This one should be reopened, since I'm still having this behavior. I'm passing settings: [kOSSettingsKeyAutoPrompt: false], but alert still shows up.

@almassapargali @nlabhart I am not able to reproduce an issue with kOSSettingsKeyAutoPrompt. Set it to false is preventing the notification permission prompt from showing. Are you calling registerUserNotificationSettings in your code or using any other notification plugins?

Note the OneSignal SDK will still fire application:didRegisterForRemoteNotificationsWithDeviceToken: however this does not show a prompt to the user on it's own.

k0SSettingsKeyAutoPrompt: false also not working for me in IOS/Swift. The notifications prompt is still showing to the user.

Was this page helpful?
0 / 5 - 0 ratings