/
Deep Linking with Cordova (Mapp Cloud)
Deep Linking with Cordova (Mapp Cloud)
Android forground
Please note that on the Android foreground, push open will not be shown
Step 1 - Listen to the "deviceready" event (iOS only)
add event listener
document.addEventListener('deviceready', this.onDeviceReady, false);
Step2 - Listen to the resume event and activate it explicitly for the first time (iOS only)
add event listener
onDeviceReady: function() {
onResume();
document.addEventListener("resume", onResume, false);
app.receivedEvent('deviceready');
console.log('Received Event: ' + id);
},
Step 3 - Implement the onResume function
When the application resumes, the following code will check if it resumed due to a push notification. If so, feel free to extract the relevant custom field from the payload.
add event listener
function onResume() {
MappPlugin.getLastPushPayload(function (json) {
var jsonString = JSON.stringify(json);
if (jsonString && jsonString.length > 2) {
alert("Last Push Payload: " + jsonString);
}
});
}
Step4 - Listen to the event and action for push and inapp (Android only)
add event listener
onDeviceReady: function() {
MappPlugin.onActionListener(
function (json) {
alert(JSON.stringify(json));
},
function (json) {
alert(JSON.stringify(json));
});
},
Related content
Deep - Linking
Deep - Linking
More like this
Cordova bridge API calls (Mapp Cloud)
Cordova bridge API calls (Mapp Cloud)
More like this
Cordova bridge API calls
Cordova bridge API calls
More like this
Cordova Integration for Mapp Cloud
Cordova Integration for Mapp Cloud
More like this
Handle Foreground Notification
Handle Foreground Notification
More like this
Adobe Air Bridge API (Mapp Cloud)
Adobe Air Bridge API (Mapp Cloud)
More like this