# Push notification is not working in ios

**URL:** <https://forum.ionicframework.com/t/push-notification-is-not-working-in-ios/51058>\
**Category:** ionic-v1\
**Created:** [May 3, 2016, 11:31am UTC](https://forum.ionicframework.com/t/push-notification-is-not-working-in-ios/51058 "2016-05-03T11:31:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AravindhJey](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@AravindhJey](https://forum.ionicframework.com/u/AravindhJey)\
**Post date:** [May 3, 2016, 11:31am UTC](https://forum.ionicframework.com/t/push-notification-is-not-working-in-ios/51058/1 "2016-05-03T11:31:12Z")

</div>

Hi friends…

```
           I am using ionic push for iphone and iPad. 
           I am following the steps from ionic push site.
           I am not able to get the device token. here is my code

     $ionicPlatform.ready(function() {
              var push = new Ionic.Push({
                "debug": true,
                 "onNotification": function(notification) {
                    var payload = notification.payload;
                    console.log(notification, payload);
                  },
                  "onRegister": function(data) {
                    console.log(data.token);
                  },
                  "pluginConfig": {
                    "ios": {
                      "badge": true,
                      "sound": true
                     },
                     "android": {
                       "iconColor": "#343434",
                       "badge": true,
                       "sound": true
                     }
                  } 
              });
              push.register(function(token) {                    
                   console.log("Device token:",token.token);                        
                   push.saveToken(token); // persist the token in the Ionic Platform
              });
            });

```

Can any one help me out this?

Note: This code works well in android.

Thanks in Advance

---

<div class="post-metadata">

**Author:** ![john\_jack\_07](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@john\_jack\_07](https://forum.ionicframework.com/u/john_jack_07)\
**Post date:** [May 25, 2016, 11:49am UTC](https://forum.ionicframework.com/t/push-notification-is-not-working-in-ios/51058/2 "2016-05-25T11:49:27Z")

</div>

Use PushNotification.init({…}) instead of new Ionic.Push({…});

It will work:slight\_smile:
