react-native-pigeon

0.4.1 • Public • Published

react-native-pigeon

Getting started

$ yarn add react-native-pigeon

or

$ npm install react-native-pigeon --save

Mostly automatic installation

$ react-native link react-native-pigeon

Usage

import Pigeon from 'react-native-pigeon';

Pigeon.setup({ publicKey: 'your_public_key' });
Pigeon.setCustomerToken('customer_token_here');

Track Events

  • Note that setCustomerToken must be called before track otherwise track won't work.
import Pigeon from 'react-native-pigeon';

// After Pigeon.setup and Pigeon.setCustomerToken
Pigeon.track('demo_event', { hello: 'world' } /* Event data */);

Listen to remote notifications

import Pigeon from 'react-native-pigeon';

// After Pigeon.setup and Pigeon.setCustomerToken
Pigeon.onMessageReceived(({ notification, data }) => {
  const { title, body } = notification;
  // Do something with data, title and body
});

Readme

Keywords

Package Sidebar

Install

npm i react-native-pigeon

Weekly Downloads

0

Version

0.4.1

License

MIT

Unpacked Size

290 kB

Total Files

150

Last publish

Collaborators

  • pigeonapp.io