Flutter Bridge API calls (Mapp Cloud)

Implement the plugin

For convenience, you should use mapp_sdk.dart and helper_classes.dart.

Initialising SDK

For the Initialization use this method as the first function in your application :

Future<String?> engage(String sdkKey, String googleProjectId, SERVER server, String appID, String tenantID)

@param {string} sdkKey - The SDK ID for your account.
@param {string} googleProjectId - The Google project id from your Firebase console for the chosen app.

googleProjectId - Can be empty String. It is not used, but it is here only for backward compatibility.

@param {string} server - The Server, which will be used for engagement, this info will be provided by account managers.
@param {string} tenantID - The ID which 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.

Server list:

  •     L3

  • L3_US

  •     EMC

  •     EMC_US

  •     CROC

Check if the device is registered in Mapp

bool isRegistered = MappSdk.isReady()

 

Alias

Get device alias

MappSdk.getAlias().then( (String value) => {_showMyDialog("Show Alias", "Alias:", value)});

Set device alias

 

Device API

Get device info (_showMyDialog is just helper method which will display alert dialog with data)

 

Push API

Push Enabled

Check if the feature is enabled.

 

Push toggle

Disable or enable push.

 

Request permission to display notification (on Android 13 and higher only)

 

Push notification received

Subscribe/listen for push received events:

For iOS also is an available listener for rich messages:

On Android some additional event handlers are available:

  • Push opened

  • Push dismissed

  • Silent push received

 

Log out

@param{boolean} pushEnabled - while logging out sets the state of receiving push messages.

In-app API

Get Inbox Messages

To get inbox messages use Mapp.fetchInboxMessage()

NOTE: Please, pay attention that on Android, messages should be received and handled in async .then() {} block. This is NOT posible on iOS.

Additional requirements for iOS only:

iOS uses events for inbox messages (didReceiveInBoxMessagesHandler )and cannot return them as promise.

 

Show In-App message

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

 

Manage In-app messages

Inapp messages can be marked as read, unread or deleted.

@param{number} templateId

@param{string} eventId

 

Geo targeting API

For Android and iOS you need to add necessary statements at info.plist and capabilities section (iOS) and Android Manifest file.

Start geo targeting feature

Stop geo targeting feature

Â