If you're looking to incorporate push notifications into your Ionic app, consider using the Cordova plugin phonegap-plugin-push. You'll need to import the Push
module from ionic-native
to integrate it with your ionic
project. Take a look at this brief example for guidance.
import {Push} from 'ionic-native' ;
push = Push.init({
android: {
senderID: "12345679"
},
browser: {
pushServiceURL: 'http://push.api.phonegap.com/v1/push'
},
ios: {
alert: "true",
badge: "true",
sound: "true"
},
windows: {}
});
this.push.on('registration', function(data) {
// data.registrationId
});
this.push.on('notification', function(data) {
// data.message,
// data.title,
// data.count,
// data.sound,
// data.image,
// data.additionalData
});
this.push.on('error', function(e) {
// e.message
});