Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
Mapp.addRichMessagesListener((notification) => {
            console.log(JSON.stringify(notification));
            Alert.alert(JSON.stringify(notification))
        });

Check if received push message is from MAPP.

@param{RemoteMessage} remoteMessage - message received from firebase messaging service.

Code Block
    Mapp.isPushFromMapp(remoteMessage).then(isMapp =>{
      console.log(isMapp);
    });

Provide firebase token to the Mapp SDK. It’s used for registring device for receiving push messages from Mapp.

@param{String} token - token generated from Firebase Messaging instance.

Code Block
Mapp.setToken(token);

Pass received firebase message to the Mapp SDK.

@param{RemoteMessage} remoteMessage - message received from firebase messaging service.

Code Block
Mapp.setRemoteMessage(remoteMessage);

Log out

@param{boolean} pushEnabled - while logging out sets push the state

...