Versions Compared

Key

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

Implement the plugin

For convenience, you should use Mapp.js and MappEventEmmiter.js.

Initialising SDK

For the Initialization use method, this function should be first in your application :

Code Block
Mapp.engage(sdkKey: string, googleProjectId: string, server: string, appID: string, tenantID: string)

@param {string} sdkID - The SDK ID for your account.
@param {string} googleProjectID - The Google project id from your Firebase console for the chosen app.
@param {string} server - The Server, which will be use used for engagement, this info will be provided by account managers.
@param {string} tenantID - The ID which recognise recognizes you at the Mapp Engage system, will be also provided by account managers.

iOS uses most information from AppoxeeCofig.plist as explained in the integration section, so you need to have that plist set up inside iOS project.

...

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

For iOS also is an available listener for rich messages:

...

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

Code Block
Mapp.logOut(pushEnabled)

...

Code Block
Mapp.setAttributeBollean("some key", true);

...

In-app API

Get Inbox Messages

To get inbox messages use Mapp.fetchInboxMessage()

...

The method triggers an In-App message.
@param {string} event  event-specific DCM event trigger. 

...

Start location monitoring

Location The location manager will be enabled and it will collect the location change events.

Code Block
Mapp.startGeoFencing()

Stop location monitoring

Location The location manager will be disabled.

...