How to use the react-native-onesignal.inFocusDisplaying function in react-native-onesignal

To help you get started, we’ve selected a few react-native-onesignal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / react-native-onesignal_v3.x.x / flow_v0.69.0-v0.103.x / test_react-native-onesignal.js View on Github external
it("must call inFocusDisplaying with FocusBehaviors type", () => {
    OneSignal.inFocusDisplaying(0);
    OneSignal.inFocusDisplaying(1);
    OneSignal.inFocusDisplaying(2);
    // $ExpectError
    OneSignal.inFocusDisplaying(3);
    // $ExpectError
    OneSignal.inFocusDisplaying();
  });
});
github flow-typed / flow-typed / definitions / npm / react-native-onesignal_v3.x.x / flow_v0.104.x- / test_react-native-onesignal.js View on Github external
it('must call inFocusDisplaying with FocusBehaviors type', () => {
    OneSignal.inFocusDisplaying(0);
    OneSignal.inFocusDisplaying(1);
    OneSignal.inFocusDisplaying(2);
    // $ExpectError
    OneSignal.inFocusDisplaying(3);
    // $ExpectError
    OneSignal.inFocusDisplaying();
  });
});
github flow-typed / flow-typed / definitions / npm / react-native-onesignal_v3.x.x / flow_v0.69.0-v0.103.x / test_react-native-onesignal.js View on Github external
it("must call inFocusDisplaying with FocusBehaviors type", () => {
    OneSignal.inFocusDisplaying(0);
    OneSignal.inFocusDisplaying(1);
    OneSignal.inFocusDisplaying(2);
    // $ExpectError
    OneSignal.inFocusDisplaying(3);
    // $ExpectError
    OneSignal.inFocusDisplaying();
  });
});
github flow-typed / flow-typed / definitions / npm / react-native-onesignal_v3.x.x / flow_v0.69.0-v0.103.x / test_react-native-onesignal.js View on Github external
it("must call inFocusDisplaying with FocusBehaviors type", () => {
    OneSignal.inFocusDisplaying(0);
    OneSignal.inFocusDisplaying(1);
    OneSignal.inFocusDisplaying(2);
    // $ExpectError
    OneSignal.inFocusDisplaying(3);
    // $ExpectError
    OneSignal.inFocusDisplaying();
  });
});
github flow-typed / flow-typed / definitions / npm / react-native-onesignal_v3.x.x / flow_v0.104.x- / test_react-native-onesignal.js View on Github external
it('must call inFocusDisplaying with FocusBehaviors type', () => {
    OneSignal.inFocusDisplaying(0);
    OneSignal.inFocusDisplaying(1);
    OneSignal.inFocusDisplaying(2);
    // $ExpectError
    OneSignal.inFocusDisplaying(3);
    // $ExpectError
    OneSignal.inFocusDisplaying();
  });
});
github pmusaraj / discourse-mobile-single-site-app / js / App.js View on Github external
componentDidMount() {
    OneSignal.addEventListener('ids', this.onIds);
    OneSignal.addEventListener('opened', this._onOpened.bind(this));
    OneSignal.inFocusDisplaying(global.inAppNotification);

    AppState.addEventListener('change', this._handleAppStateChange);

    // Android only: clear notifications (badge count) when user is in app
    if (Platform.OS !== 'ios') {
      OneSignal.clearOneSignalNotifications();
    }

    AsyncStorage.getItem('@Discourse.skipLogin').then(json => {
      if (json && json === 'loginSkipped') {
        this.setState({skipLogin: true});
      }
    });

    this.keyboardDidShowListener = Keyboard.addListener(
      'keyboardDidShow',
github egm0121 / splitcloud-app / index.ios.js View on Github external
initPushNotifications(){
    console.log('setting up PushNotifications OneSignal SDK');
    OneSignal.init(config.ONE_SIGNAL_APP_ID,{kOSSettingsKeyAutoPrompt : true});
    OneSignal.inFocusDisplaying(0);
    OneSignal.setLocationShared(false);
    OneSignal.setExternalUserId(AnalyticsService.uniqueClientId);
  }
  bindNotificationListeners(){
github mhdrare / Shovee-Frontend / src / screens / Checkout.js View on Github external
constructor(props) {
        super(props);

        this.deviceID = ''

        OneSignal.init("df4cae47-cd9d-4dd5-b97f-5f63593f39fb")
        OneSignal.inFocusDisplaying(2)
        
        OneSignal.addEventListener('received', this.onReceived);
        OneSignal.addEventListener('opened', this.onOpened);
        OneSignal.addEventListener('ids', device => {
            this.deviceID = device.userId
        });
        OneSignal.configure();

        this.state = {
            checked: false,
            count: 0,
            isLoading: false,
            data: [
                {
                    id: '1',
                    seller: 'grosir.outdoor.shop',
github jsappme / react-native-firebase-starter / src / app.js View on Github external
componentDidMount() {
    console.log("-------xxxx------ App - componentDidMount ------xxxx-------")
    OneSignal.inFocusDisplaying(0)
    OneSignal.configure({
      onNotificationReceived: function(notification) {
        //console.log('NOTIFICATION RECEIVED: ', notification)
        if (notification.payload.additionalData.new_message && appStore.current_puid != notification.payload.additionalData.puid) {
          console.log("       appStore.new_messages + 1 : " + appStore.current_puid)
          appStore.new_messages = appStore.new_messages + 1
        }
      },
      onNotificationOpened: function(openResult) {
        console.log(openResult);
        console.log('MESSAGE: ', openResult.notification.payload.body)
        console.log('CURRENT PUID:' + appStore.current_pui)
        console.log('ISACTIVE: ', openResult.notification.isAppInFocus)
        console.log('DATA: ', openResult.notification.payload.additionalData)
        if (!openResult.notification.isAppInFocus) {
          if (openResult.notification.payload.additionalData) {
github hummingbird-me / kitsu-mobile / src / App.js View on Github external
componentWillMount() {
    OneSignal.inFocusDisplaying(2);
    OneSignal.addEventListener('ids', this.onIds);
    OneSignal.addEventListener('registered', this.onPNRegistered);
    OneSignal.addEventListener('received', this.onReceived);
    OneSignal.addEventListener('opened', this.onOpened);
    this.unsubscribe = store.subscribe(this.onStoreUpdate);
    this.unsubscribeCreate = KitsuLibrary.subscribe(KitsuLibraryEvents.LIBRARY_ENTRY_CREATE, this.onLibraryEntryCreated);
    this.unsubscribeUpdate = KitsuLibrary.subscribe(KitsuLibraryEvents.LIBRARY_ENTRY_UPDATE, this.onLibraryEntryUpdated);
    this.unsubscribeDelete = KitsuLibrary.subscribe(KitsuLibraryEvents.LIBRARY_ENTRY_DELETE, this.onLibraryEntryDeleted);
  }