Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OneSignal.inFocusDisplaying(0) not working in iOs #157

Closed
bitcoinvsalts opened this issue Jan 23, 2017 · 5 comments
Closed

OneSignal.inFocusDisplaying(0) not working in iOs #157

bitcoinvsalts opened this issue Jan 23, 2017 · 5 comments

Comments

@bitcoinvsalts
Copy link

OneSignal.inFocusDisplaying(0)
OneSignal.configure({...

gives me on android, displayType: 0, and does not show the notification

But with iOS, it gives me, displayType: 1, it does show the notification when the app is isAppInFocus

@bitcoinvsalts
Copy link
Author

I just read the doc again I saw: We exposed the inFocusDisplaying API of OneSignal (Android only).

How can I not display the notification on iOS when the app is in Focus ?

@avishayil
Copy link
Contributor

avishayil commented Jan 23, 2017

in your AppDelegate.m you can put the settings dictionary (optional) and change some default OneSignal settings:

  self.oneSignal = [[RCTOneSignal alloc] initWithLaunchOptions:launchOptions
                     appId:@"YOUR APP ID"
                     settings:@{kOSSettingsKeyInFocusDisplayOption : @(OSNotificationDisplayTypeNone), kOSSettingsKeyAutoPrompt : @YES}];

Sorry for the undocumented part in the module, you can find it here, in the official SDK docs:
https://documentation.onesignal.com/docs/ios-native-sdk#section--kossettingskeyinfocusdisplayoption-

@dzpt
Copy link

dzpt commented Sep 23, 2017

@jsappme @avishayil Hi, if i want to silent the notification on one particular app screen only not whole app, how do i do it?

@wprater
Copy link

wprater commented Jan 25, 2018

this now works on the latest SDK

@noway
Copy link

noway commented Aug 2, 2019

@avishayil I'm getting "Property 'oneSignal' not found on object of type 'AppDelegate *'", with that code, how would I properly define that property for app delegate and do I need to pass the property to onesignal back somehow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants