Push Notification is implemented using the ExactTarget Push APIs and Cordova Plugin.
In the Nibs mobile app, when a consumer shares an Offer or a Product on Facebook, Nibs pushes a message (currently to all Nibs users, but it could be to friends only in a real life app):
Tapping the notification opens the Nibs app on the related Product or Offer.
A "Push Offer" Publisher Action has been added to the Offer object (available in the Salesforce browser app or Salesforce1 app). When you select that action, a "Push Offer" page appears with a default message "Exclusive Offer: [offer name]", that you can customize before sending.
Publisher Action in the browser:
Publisher Action in S1 App:
Tapping the notification opens the app on the related offer.
The Loyalty app in Salesforce has a Push Notification tab that loads the PushAdmin Visualforce page (available in the Salesforce browser app or Salesforce1 app). You can use this page to push adhoc messages to all users, or to a group of users identified by their subscriber key (email address).
PushAdmin in the Browser:
Push Admin in S1 App:
Push Messages analytics can be tracked in the ET dashboard:
The ExactTarget Mobile Push SDK works for both native and Hybrid apps. Here is a code example to register for notifications in a hybrid app:
ETPush.registerForNotifications(
function() {
console.log('registerForNotifications: success');
},
function(error) {
console.log('registerForNotifications: error - ' + JSON.stringify(error));
},
"onNotification" // Function name as a string. The function to invoke when a message comes in.
);
ETPush.resetBadgeCount();
// Associate a subscriber alias with the token
if (user && user.email) {
console.log('Subscribing for Push as ' + user.email);
ETPush.setSubscriberKey(
function() {
console.log('setSubscriberKey: success');
},
function(error) {
console.log('Error setting Push Notification subscriber');
},
user.email
);
}
You can then use the ExactTarget APIs to post messages to regitsred devices.