pressenger-expo-plugin
v2.1.30
Published
## Installation
Downloads
44
Readme
Pressenger Expo Plugin
Installation
- Install the react-native-pressenger-sdk by
npm i react-native-pressenger-sdk
- Install this plugin by
npm i pressenger-expo-plugin
- Follow the steps of the official Google documentation to setup Firebase
- Add Google Services config file paths to the iOS config and Android config
- Add plugin setup to app.json:
...
"plugins": [
[
"pressenger-expo-plugin",
{
"groupId": "... pressenger group id ...",
"devTeam": "... Apple dev team id ..."
}
]
]
...
- Run
npx expo prebuild
(also needed if you use EAS Build)
Usage
Initialize the SDK by
import PressengerSDK from 'react-native-pressenger-sdk';
PressengerSDK.initWithConfig((event) => {
// in-app event handling, the in-app url will be in event.url field
});
You can ask permission to show notifications (on Android) by
PressengerSDK.requestNotificationEnabled();
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 ...');