Reputation: 609
I just learning Ionic framework and want to know something according to push notifications.
In my app i have user-groups and i want to let the user send push-notifications to their groupmembers.
Is this possible? Can i use Ionic-push for this or maybe push.js ?
Thanks in advance!
Upvotes: 0
Views: 266
Reputation: 6094
You can use Cordova plugin phonegap-plugin-push . You have to import Push
from ionic-native
to use it in ionic
. Here is a quick example.
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
});
Upvotes: 1