Reputation: 11
I'm using onesignal-react-native for my react native app. However, I have an issue with alert on ios app. I don't know how to turn the alert off so that it doesn't show up when the users in app. How can I turn it off ?
Upvotes: 1
Views: 429
Reputation: 606
For anyone looking into this in the future you will need to add this to your AppDelegate.m
self.oneSignal = [[RCTOneSignal alloc] initWithLaunchOptions:launchOptions
appId:@"app-id"
settings:@{kOSSettingsKeyInFocusDisplayOption : @(OSNotificationDisplayTypeNotification),kOSSettingsKeyAutoPrompt : @YES}];
For android just add
OneSignal.inFocusDisplaying(0);
Hope it helps.
Upvotes: 1