Skip to content

1.6.0

Compare
Choose a tag to compare
@pedro-lb pedro-lb released this 24 Aug 23:41

🔥 New setup hook!

You can now use the new setup hook to setup your OneSignal settings as soon as OneSignal is initialized into the page. This makes it much easier for you to apply your settings since you don't have to check if OneSignal is initialized or not! 😆

Here's a quick example:

import OneSignal, { useOneSignalSetup } from 'react-onesignal';

type AppProps = {
  user: {
    id: string;
    email: string;
  };
};

function App(props: AppProps) {
  const { user } = props;

  useOneSignalSetup(() => {
    OneSignal.setEmail(user.email);
    OneSignal.setExternalUserId(user.id);
  });
}

🔥 New functions

This version adds two more functions to help setup OneSignal:

  • logoutEmail
  • removeExternalUserId

Examples:

import OneSignal from 'react-onesignal';

// Remove email tracking
OneSignal.logoutEmail();

// Remove external user ID
OneSignal.removeExternalUserId();

💅 Improvements

This version also brings up some improvements, raising the bar on code quality and upgrading some dependencies.

Thanks to @BigsonLvrocha for the contributions! 🚀