JSPM

  • Created
  • Published
  • Downloads 36177
  • Score
    100M100P100Q170872F
  • License MIT

React OneSignal Module: Make it easy to integrate OneSignal with your React App!

Package Exports

  • react-onesignal

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-onesignal) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

React OneSignal

NPM JavaScript Style Guide

This is a JavaScript module that can be used to easily include OneSignal code in a website or app that uses React for its front-end codebase.

OneSignal is the world's leader for Mobile Push Notifications, Web Push, and In-App Messaging. It is trusted by 800k businesses to send 5 billion Push Notifications per day.

You can find more information on OneSignal here.

Install

You can use yarn or npm.

Yarn

yarn add react-onesignal

npm

npm install --save react-onesignal

Usage

Simply initialize OneSignal with your token:

import OneSignal from 'react-onesignal';

OneSignal.initialize('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');

// Set email to track & notify specific users
OneSignal.setEmail('my_email@example.com');

// Check which email is configured in this browser
const emailId = await OneSignal.getEmailId();

Contributing

Pull requests are welcome! If you have any feedback, issue or suggestion, feel free to open a new issue so we can talk about it 💬.

License

MIT © pedro-lb