...
Request permission to display notification (on Android 13 and higher only)
Code Block |
---|
|
final result = await MappSdk.requestPermissionPostNotifications();
debugPrint("POST NOTIFICATION PERMISSION RESULT: " + result.toString());
if (!result) {
_showMyDialog(
"POST NOTIFICATION", "Permission result", "Permission was denied!");
} |
...
On Android some additional event handlers are available:
Code Block |
---|
|
void pushOpenedHandler(dynamic arguments) {
print("Push opened!");
print(arguments);
}
MappSdk.handledPushOpen =
(dynamic arguments) => pushOpenedHandler(arguments); |
Code Block |
---|
|
void pushDismissedHandler(dynamic arguments) {
print("Push dismissed!");
print(arguments);
}
MappSdk.handledPushDismiss =
(dynamic arguments) => pushDismissedHandler(arguments); |
Code Block |
---|
|
void pushSilentHandler(dynamic arguments) {
print("Push silent!");
print(arguments);
}
MappSdk.handledPushSilent =
(dynamic arguments) => pushSilentHandler(arguments); |
...
To get inbox messages use Mapp.fetchInboxMessage()
Code Block |
---|
|
if (Platform.isAndroid) {
MappSdk.fetchInboxMessage().then((messages) {
_showMyDialog("Inbox messages", "", messages);
});
} else {
MappSdk.fetchInboxMessage();
} |
...
Start geo targeting feature
Code Block |
---|
|
MappSdk.startGeoFencing().then((status) {
debugPrint("Start Geofencing status:" + status);
// handle successfull start of geo targeting
}).catchError((e) {
debugPrint("Start Geofencing error:" + e.toString());
// handle errors
}); |
Stop geo targeting feature
Code Block |
---|
|
MappSdk.stopGeoFencing().then((status) {
debugPrint("Stop Geofencing status:" + status);
// handle successfull stoping of geo targeting
}).catchError((e) {
debugPrint("Stop Geofencing error:" + e.toString());
// handle errors
}); |
...