Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .run(function($ionicPlatform, $rootScope) {
- $ionicPlatform.ready(function() {
- var push = PushNotification.init({
- android: {
- senderID: "411587591993"
- },
- browser: {
- pushServiceURL: 'http://push.api.phonegap.com/v1/push'
- },
- ios: {
- alert: "true",
- badge: "true",
- sound: "true"
- },
- windows: {}
- });
- push.on('registration', function(data) {
- console.log("Device Token: " + data.registrationId);
- $rootScope.devToken = data.registrationId;
- })
- push.on('notification', function(data) {
- if (data.additionalData.foreground) {
- alert(data.message);
- }
- })
- push.on('error', function(e) {
- console.log(e.message);
- });
- });
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement