MFPPush.initialize(function(successResponse){
MFPPush.registerNotificationsCallback(notificationReceived); },
function(failureResponse){
alert("Failed to initialize”);
}
);
var notificationReceived = function(message) {
alert(JSON.stringify(message));
};
MFPPush.registerDevice(function(successResponse) {
alert("Successfully registered");
},
function(failureResponse) {
alert("Failed to register");
}
);
MFPPush.unregisterDevice(function(successResponse) {
alert("Successfully unregistered");
},
function(failureResponse) {
alert("Failed to unregister");
}
);
MFPPush.isPushSupported (function(successResponse) {
alert(successResponse);
},
function(failureResponse) {
alert("Failed to get the push suport status");
}
);
var tags = ['sample-tag1','sample-tag2']
MFPPush.subscribe(tags, function(successResponse) {
alert("Successfully subscribed");
},
function(failureResponse) {
alert("Failed to subscribe");
}
);
MFPPush.unsubscribe(tags, function(successResponse) {
alert("Successfully unsubscribed");
},
function(failureResponse) {
alert("Failed to unsubscribe");
}
);
Server
Remove the following WL.Server.sendMessage() (if used) in your adapter.
You can also set up the credentials by using Update GCM settings (PUT) REST API, for Android applications or Update APNs settings (PUT) REST API, for iOS applications.