react-native-pressenger-sdk
v2.3.36
Published
Pressenger SDK for React Native (https://pressenger.com)
Downloads
26
Maintainers
Readme
Pressenger SDK for React Native
Installation
Android
- Follow the steps of the official Google documentation to install Firebase Cloud Messaging into your app: https://firebase.google.com/docs/android/setup
- Install this package by
npm install react-native-pressenger-sdk --save
- 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 ...');