Need Private Modules

    react-native-pressenger-sdk

    1.2.6 • Public • Published

    Pressenger SDK for React Native

    Installation

    1. Follow the steps of the official Google documentation to install Firebase Cloud Messaging into your app: https://firebase.google.com/docs/android/setup
      • Add classpath 'com.google.gms:google-services:4.3.3' to your top-level build file (android/build.gradle) into the buildscript/dependencies section.
      • Add apply plugin: 'com.google.gms.google-services' to your project-level build file (android/app/build.gradle) after apply plugin: 'com.android.application'.
      • Copy the generated google-services.json to your android project directory (android/app).
    2. Install this package by npm install react-native-pressenger-sdk --save
    3. Add maven { url 'https://maven.pressenger.com' } to your top-level build file (android/build.gradle) into the allprojects/repositories section.
    4. Add implementation 'com.pressenger:sdk:4.16.2' to your project-level build file (android/app/build.gradle) into the dependencies section.
    5. Add <meta-data android:name="pressenger_groupid" android:value="...your group id goes here..." /> to your app manifest (android/app/src/main/AndroidManifest.xml) into the application section.

    Usage

    The SDK will be automatically initialized when the application starts, so without any coding you can send messages to all of the devices.

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

    import PressengerSdk from 'react-native-pressenger-sdk';
     
    PressengerSdk.subscribeToTopic('... topic name ...', function (result) {
        ...
    });
     
    PressengerSdk.unsubscribeFromTopic('... topic name ...', function (result) {
        ...
    });
     

    Install

    npm i react-native-pressenger-sdk

    DownloadsWeekly Downloads

    10

    Version

    1.2.6

    License

    none

    Unpacked Size

    612 kB

    Total Files

    46

    Last publish

    Collaborators

    • thebojda