How to use the react-native-onesignal.init 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 init with id and oprtions for IOS", () => {
  var IOSSettings = {};

  OneSignal.init("id");
  OneSignal.init("id", IOSSettings);
  // $ExpectError
  OneSignal.init();
});
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 init with id and oprtions for IOS", () => {
  var IOSSettings = {};

  OneSignal.init("id");
  OneSignal.init("id", IOSSettings);
  // $ExpectError
  OneSignal.init();
});
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 init with id and oprtions for IOS", () => {
  var IOSSettings = {};

  OneSignal.init("id");
  OneSignal.init("id", IOSSettings);
  // $ExpectError
  OneSignal.init();
});
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 init with id and oprtions for IOS', () => {
  var IOSSettings = {};

  OneSignal.init('id');
  OneSignal.init('id', IOSSettings);
  // $ExpectError
  OneSignal.init();
});
github mustafaskyer / rigel-rn / App / App.js View on Github external
constructor() {
    super();
    i18n.locale = "tr"; // manually set language
    EStyleSheet.build({
      ...colors,
      ...fonts
    });

    OneSignal.init("98036549-9d8f-40fd-abdf-05fc18d89f2c");
    OneSignal.addEventListener("received", this.onReceived);
    OneSignal.addEventListener("opened", this.onOpened);
    OneSignal.addEventListener("ids", this.onIds);
    OneSignal.configure(); // triggers the ids event
  }
  componentWillUnmount() {
github Flaque / quirk / src / id / index.ts View on Github external
export async function identify() {
  try {
    let userID = await idstore.getUserID();
    if (!userID) {
      userID = "user-" + uuidv4();
    }
    await idstore.storeUserID(userID);

    // Identify in RevenueCat
    Payments.alias(userID);

    // Identify in OneSignal
    OneSignal.init(ONESIGNAL_SECRET, {
      kOSSettingsKeyAutoPrompt: false,
      kOSSettingsKeyInFocusDisplayOption: 0,
    });
    OneSignal.sendTag("userID", userID);

    // Identify in Segment
    stats.identify(userID);
  } catch (err) {
    // Just capture the exception and continue, don't :rip:
    Sentry.captureException(err);
  }
}
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 Flaque / quirk / src / SettingsScreen.tsx View on Github external
async componentDidMount() {
    OneSignal.init(ONESIGNAL_SECRET, {
      kOSSettingsKeyAutoPrompt: false,
      kOSSettingsKeyInFocusDisplayOption: 0,
    });
    await this.refresh();
  }
github Flaque / quirk / src / onboarding / NotificationScreen.tsx View on Github external
componentDidMount() {
    OneSignal.init(ONESIGNAL_SECRET, {
      kOSSettingsKeyAutoPrompt: false,
      kOSSettingsKeyInFocusDisplayOption: 0,
    });
  }
github pmusaraj / discourse-mobile-single-site-app / js / App.js View on Github external
constructor(props) {
    super(props);
    OneSignal.init(global.oneSignalAppId, {kOSSettingsKeyAutoPrompt: false});

    this.state = {
      uri: site,
      promptToConnect: false,
      skipLogin: false,
      appLoading: true,
      username: '',
      password: '',
      authError: '',
      keyboardVisible: false,
      landscapeLayout: false,
      appState: AppState.currentState,
      pushAuth: false,
    };

    this._Manager = new Manager();