Closed vmacavero closed 7 years ago
If I understand correctly, do you want to request permission through RequestPermission, and then initialize OneSignal?
exactly ! the problem is the onesignal init happens before i'm able to instantiate RequestPermission.
Thanks.
Victor
@vmacavero, use EventDelegate. Once the user permits notifications - initialize onesignal
ok, Thanks Ivan. I'll Try. 👍
@vmacavero there is a setting, to disable auto-prompt
OneSignal.initWithLaunchOptions(launchOptions, appId: AppDelegate.OS_APP_ID,
handleNotificationReceived: {},
handleNotificationAction: {_ in},
settings: [kOSSettingsKeyAutoPrompt:false])
Check docs: https://documentation.onesignal.com/docs/ios-native-sdk#section--kossettingskeyautoprompt-
Hi, i'm currently using OneSignal for my push notifications in my iOS project. To instantiate OneSignal, i have to do `OneSignal.initWithLaunchOptions(....)' in the Application.DidFinishingLaunchingWithOption func of the Application Delegate. This automatically fires the standard request for Push Permissions.
I'd Like to use RequestPermission before all of this happens, but seems i can't because i've to instantiate RequestPermission in a Controller (and none is created at the Application Delegate flow of the app).
Is there a way/workaround ?
Thanks!
Victor