How to use the react-native-onesignal.removeEventListener 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.104.x- / test_react-native-onesignal.js View on Github external
// $ExpectError: check any
      (event.userId: boolean);
    });
    OneSignal.addEventListener('inAppMessageClicked', event => {
      (event.clickUrl: ?string);
      (event.clickName: ?string);
      (event.firstClick: boolean);
      (event.closesMessage: boolean);

      // $ExpectError: check any
      (event.closesMessage: number);
    });

    OneSignal.removeEventListener('received', simpleHandler);
    OneSignal.removeEventListener('opened', simpleHandler);
    OneSignal.removeEventListener('ids', simpleHandler);
    OneSignal.removeEventListener('emailSubscription', simpleHandler);
    OneSignal.clearListeners();
  });
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
(event.userId: boolean);
    });
    OneSignal.addEventListener('inAppMessageClicked', event => {
      (event.clickUrl: ?string);
      (event.clickName: ?string);
      (event.firstClick: boolean);
      (event.closesMessage: boolean);

      // $ExpectError: check any
      (event.closesMessage: number);
    });

    OneSignal.removeEventListener('received', simpleHandler);
    OneSignal.removeEventListener('opened', simpleHandler);
    OneSignal.removeEventListener('ids', simpleHandler);
    OneSignal.removeEventListener('emailSubscription', simpleHandler);
    OneSignal.clearListeners();
  });
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 addEventListener and removeEventListener with supported event types", () => {
    const simpleHandler = () => {};

    OneSignal.addEventListener("received", simpleHandler);
    OneSignal.addEventListener("opened", simpleHandler);
    OneSignal.addEventListener("ids", simpleHandler);
    OneSignal.addEventListener("emailSubscription", simpleHandler);

    OneSignal.removeEventListener("received", simpleHandler);
    OneSignal.removeEventListener("opened", simpleHandler);
    OneSignal.removeEventListener("ids", simpleHandler);
    OneSignal.removeEventListener("emailSubscription", simpleHandler);
    OneSignal.clearListeners();
  });
github StoDevX / AAO-React-Native / source / app.js View on Github external
componentWillUnmount() {
		OneSignal.removeEventListener('received', this.onReceived)
		OneSignal.removeEventListener('opened', this.onOpened)
		OneSignal.removeEventListener('ids', this.onIds)
	}
github hummingbird-me / kitsu-mobile / src / App.js View on Github external
componentWillUnmount() {
    OneSignal.removeEventListener('ids', this.onIds);
    OneSignal.removeEventListener('registered', this.onPNRegistered);
    OneSignal.removeEventListener('received', this.onReceived);
    OneSignal.removeEventListener('opened', this.onOpened);
    this.unsubscribe();
    this.unsubscribeCreate();
    this.unsubscribeUpdate();
    this.unsubscribeDelete();
  }
github wendelfreitas / animavita / mobile / src / index.js View on Github external
return () => {
      OneSignal.removeEventListener('received', this.onReceived);
      OneSignal.removeEventListener('opened', this.onOpened);
      OneSignal.removeEventListener('ids', this.onIds);
    };
  }, []);
github Weakky / prisma-ecommerce / mobile / src / views / home / Home.js View on Github external
componentWillUnmount() {
    OneSignal.removeEventListener('ids', this.onIds);
    this.subscription.unsubscribe();
  }
github mhdrare / Shovee-Frontend / App.js View on Github external
componentWillUnmount() {
    OneSignal.removeEventListener('received', this.onReceived);
    OneSignal.removeEventListener('opened', this.onOpened);
    OneSignal.removeEventListener('ids', this.onIds);
  }
github wendelfreitas / animavita / mobile / src / index.js View on Github external
return () => {
      OneSignal.removeEventListener('received', this.onReceived);
      OneSignal.removeEventListener('opened', this.onOpened);
      OneSignal.removeEventListener('ids', this.onIds);
    };
  }, []);