npm.io
2.3.52 • Published 3h ago

react-native-pressenger-sdk

Licence
Version
2.3.52
Deps
0
Size
46 kB
Vulns
0
Weekly
0

Pressenger SDK for React Native

Installation

Android

  1. Follow the steps of the official Google documentation to install Firebase Cloud Messaging into your app: https://firebase.google.com/docs/android/setup
  2. Install this package by npm install react-native-pressenger-sdk --save
  3. Add maven { url 'https://maven2.pressenger.com' } to your top-level build file (android/build.gradle) into the allprojects/repositories section.

Usage

Initialize the SDK by

import PressengerSDK from 'react-native-pressenger-sdk';

PressengerSDK.init('... your group id goeas here ...', (event) => {
    // in-app event handling, the in-app url will be in event.url field
});

If you need topic management (subscribe to/unsubscribe from topic) then you can do it easily by

PressengerSDK.subscribeToTopic('... topic name ...');
PressengerSDK.unsubscribeFromTopic('... topic name ...');

Keywords