# Push notifications problem as of february 2016 new problem because of updating

**URL:** <https://forum.ionicframework.com/t/push-notifications-problem-as-of-february-2016-new-problem-because-of-updating/42887>\
**Category:** uncategorized\
**Created:** [February 4, 2016, 1:48pm UTC](https://forum.ionicframework.com/t/push-notifications-problem-as-of-february-2016-new-problem-because-of-updating/42887 "2016-02-04T13:48:15Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdabrowski123](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@jdabrowski123](https://forum.ionicframework.com/u/jdabrowski123)\
**Post date:** [February 4, 2016, 1:48pm UTC](https://forum.ionicframework.com/t/push-notifications-problem-as-of-february-2016-new-problem-because-of-updating/42887/1 "2016-02-04T13:48:15Z")

</div>

Okay people. This entire process changed and now suddenly errors.

> **[Ionic Services Docs](http://legacy-cloud-docs.ionic.io)**
>
> Documentation for the Ionic Services Service: Push, Users, Package, and Deploy

First of all this page now says to install the phonegappush plugin. Before it said to create a new project with the push template. (i.e. ionic start project\_name push). Have a look at it now. It is different. You know when you release a new version of ionic one thing you should be doing is to test push notifications since many thousands of apps will no longer work anymore and developers will be very angry with you for not thinking it through. Okay perhaps you did test it. Fine. Make sure you update the intructions for how to register for push when the app is loaded or when the user logs in or whenever you want us to be doing this now. See the above link step #5. WTF is that? It does nothing when the app is loaded. I get nothing in the console log but the annoying

"TypeError: Cannot read property ‘pushNotification’ of undefined

This page indicates that the push plugin you were using is now deprecated and the instructions above say you are moving forward with the phonegappush plugin instead. Fine but the instructions on this page are now not complete. You have the setup of the keys on the google developers console and the apple keys of which I do not need any help and I am very well aware of how this works. It was working before you decided to change things. Now that it doesn’t work anymore (I stupidly decided to let MacOSX update Xcode to 7.2 and now I am screwed). I guess I have to watit around for a fix at ionic or the instructions page to be updated. Of course you will not do this because you will disagree with me even though I am right. I am very sorry to speak like this but it is very sloppy work on your part to do stuff like this. It has been in GA since early last year. And you change push notifications frequently. They don’t need to be changed, but you change them. All we want is to just see messages pop up on both iOS and Android and done. There is no need to get fancy with this. Why do you think it needs to change this often.

Thank you ionic for wasting my time.

> **[phonegap-build/PushPlugin](https://github.com/phonegap-build/PushPlugin)**
>
> PushPlugin - This repository is deprecated head to phonegap/phonegap-push-plugin

Fine whatever. Typically what I do when I ahve problems is to recreate a new project from scratch from the latest instructions.

---

<div class="post-metadata">

**Author:** ![OJCode14](https://avatars.discourse-cdn.com/v4/letter/o/ce7236/32.png) [@OJCode14](https://forum.ionicframework.com/u/OJCode14)\
**Post date:** [February 4, 2016, 3:13pm UTC](https://forum.ionicframework.com/t/push-notifications-problem-as-of-february-2016-new-problem-because-of-updating/42887/2 "2016-02-04T15:13:28Z")

</div>

I get that you’re frustrated but this is a FREE framework that a ton of people have put a lot of time into. I’m struggling with a similar issue, but while also frustrated I try to keep it civil and let my angst out elsewhere, please for the respect of others try and do the same.

---

<div class="post-metadata">

**Author:** ![jdabrowski123](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@jdabrowski123](https://forum.ionicframework.com/u/jdabrowski123)\
**Post date:** [February 4, 2016, 3:38pm UTC](https://forum.ionicframework.com/t/push-notifications-problem-as-of-february-2016-new-problem-because-of-updating/42887/3 "2016-02-04T15:38:50Z")

</div>

If you do not have anything constructive to say then please just shut up.

---

<div class="post-metadata">

**Author:** ![OJCode14](https://avatars.discourse-cdn.com/v4/letter/o/ce7236/32.png) [@OJCode14](https://forum.ionicframework.com/u/OJCode14)\
**Post date:** [February 4, 2016, 3:41pm UTC](https://forum.ionicframework.com/t/push-notifications-problem-as-of-february-2016-new-problem-because-of-updating/42887/4 "2016-02-04T15:41:42Z")

</div>

What I said _was_ constructive, in that it attempts to help keep the experience useful and enjoyable for all involved. You think you’re the only one who gets frustrated? This isn’t the place for your vitriol.

---

<div class="post-metadata">

**Author:** ![jdabrowski123](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@jdabrowski123](https://forum.ionicframework.com/u/jdabrowski123)\
**Post date:** [February 8, 2016, 7:34pm UTC](https://forum.ionicframework.com/t/push-notifications-problem-as-of-february-2016-new-problem-because-of-updating/42887/5 "2016-02-08T19:34:12Z")

</div>

By constructive I meant something that solves the problem. The purpose of this forum. Duh.

Other people’s enjoyment and happiness is completely irrelevant. Hell even my own happiness is irrelevant. The only thing that matters is my work and the advancement of my own mind.

As for me thinking I am the only developer that is frustrated… Being one of the best that is out there I imagine most developers would have more problems and more frustrated than me. So you made an incorrect statement. Anyway whatever. I am done with this conversation don’t bother responding.

---

<div class="post-metadata">

**Author:** ![ihadeed](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ihadeed/32/95258_2.png) [@ihadeed](https://forum.ionicframework.com/u/ihadeed)\
**Post date:** [February 8, 2016, 7:59pm UTC](https://forum.ionicframework.com/t/push-notifications-problem-as-of-february-2016-new-problem-because-of-updating/42887/6 "2016-02-08T19:59:09Z")

</div>

**EDIT** : This method intended to be used with your own server, not with [Ionic.io](http://Ionic.io) services. I use my own servers and connect them directly to Google Cloud Messaging (free service) that pushes my notifications to both my Android and iOS users. This allows me to have full control over all the notifications that are being sent.

Hi there,

I hope this might help you somehow.

1. Install the following plugin: [https://github.com/phonegap/phonegap-plugin-push](https://github.com/phonegap/phonegap-plugin-push)

2. Create a service that registers and unregisters the device with Google Cloud Messaging (GCM)

3. In my case, my application has user authentication. So whenever the user logs in I call the function PUSH\_NOTIFICATIONS.init(). So if you don’t have user authentication and you would like to register every user then just call this function inside your .run()

---

<div class="post-metadata">

**Author:** ![jdabrowski123](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@jdabrowski123](https://forum.ionicframework.com/u/jdabrowski123)\
**Post date:** [February 8, 2016, 8:28pm UTC](https://forum.ionicframework.com/t/push-notifications-problem-as-of-february-2016-new-problem-because-of-updating/42887/7 "2016-02-08T20:28:11Z")

</div>

This is great thanks. Actually I am doing user authentication. So yes it has to be done after the user logs in. Or clicks the activate user link from their email inbox linking into my application.

I will of course do something very similar to this. I just didn’t know what the javascript should look like to interact with the new version of the push plugin. Basically I look at my own code okay and people on my team (when I am on a team) but I quickly get confused having to look at code in the framework and knowing precisely what will be called and in which file.

How did you figure this out? Which file in the ionic framework is this defined in. I searched for it and found thousands of references and I don’t have time to look through it all. I am assuming you figured it out by looking at the framework code. That is since this is not documented anywhere.

---

<div class="post-metadata">

**Author:** ![ihadeed](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ihadeed/32/95258_2.png) [@ihadeed](https://forum.ionicframework.com/u/ihadeed)\
**Post date:** [February 8, 2016, 8:37pm UTC](https://forum.ionicframework.com/t/push-notifications-problem-as-of-february-2016-new-problem-because-of-updating/42887/8 "2016-02-08T20:37:27Z")

</div>

I didn’t look at Ionic Framework code to figure this out since it is not really related to Ionic framework.

When I was trying to add push notifications I stumbled upon the link you shared in your original post along with a few other outdated pages such as ngCordova’s site. And I was as frustrated as you are with the outdated information… so I decided to dig through the original plugin’s documentation which explains how to implement the functions on any Cordova based application.

The documentation can be found here: [https://github.com/phonegap/phonegap-plugin-push/tree/master/docs](https://github.com/phonegap/phonegap-plugin-push/tree/master/docs)

After testing out many things with the documentation and setting up my GCM services correctly, I used $cordovaDevice plugin to get information about the current device … such as serial number and platform … etc.

And most importantly you need to wrap the whole functionality with the device.ready listener that ensures the Cordova library and all plugins are successfully loaded. Hence why I used $ionicPlatform.ready().

---

<div class="post-metadata">

**Author:** ![OJCode14](https://avatars.discourse-cdn.com/v4/letter/o/ce7236/32.png) [@OJCode14](https://forum.ionicframework.com/u/OJCode14)\
**Post date:** [February 15, 2016, 2:47pm UTC](https://forum.ionicframework.com/t/push-notifications-problem-as-of-february-2016-new-problem-because-of-updating/42887/9 "2016-02-15T14:47:13Z")

</div>

What are you sending to GCM from your server, I can’t seem to get that part of it to work for ios/android?

---

<div class="post-metadata">

**Author:** ![bnawaz168](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@bnawaz168](https://forum.ionicframework.com/u/bnawaz168)\
**Post date:** [February 27, 2016, 8:37pm UTC](https://forum.ionicframework.com/t/push-notifications-problem-as-of-february-2016-new-problem-because-of-updating/42887/12 "2016-02-27T20:37:25Z")

</div>

I’m also experiencing this issue, after adding the ionic-web-platform plugin (as part of the tutorial) my app would no longer load in emualtors and on devices, I’ve verified this by copying over my code to a new project which works completely perfectly until I run ‘ionic add ionic-web-platform’ etc etc, and to make matters worse, the plugin isn’t properly removed from ionic.bundle.min.js after running ‘ionic remove ionic-web-platform’ command.

Would really like an updated tutorial/fix for this so I can use push notifications in my project!

---

<div class="post-metadata">

**Author:** ![krva](https://avatars.discourse-cdn.com/v4/letter/k/8baadc/32.png) [@krva](https://forum.ionicframework.com/u/krva)\
**Post date:** [April 7, 2016, 3:22am UTC](https://forum.ionicframework.com/t/push-notifications-problem-as-of-february-2016-new-problem-because-of-updating/42887/13 "2016-04-07T03:22:25Z")

</div>

Have you solved your issue? I’m stucked! =(

---

<div class="post-metadata">

**Author:** ![manikdp](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@manikdp](https://forum.ionicframework.com/u/manikdp)\
**Post date:** [April 20, 2016, 8:40pm UTC](https://forum.ionicframework.com/t/push-notifications-problem-as-of-february-2016-new-problem-because-of-updating/42887/14 "2016-04-20T20:40:59Z")

</div>

Hi,

I tried this code, it is working fine and received notification in Android and iOS. But when I click push notification its redirect to index page. I need to redirect to specific page in my app.  
I used $state.go(‘aaaa’) inside push.on(‘notification’, function(data){) method, it doesn’t work. please let me know which method will trigger while click the push notification?

Here is my code.

push.on(‘notification’, function(data){  
// Here is what we will do if we get a push notification while using the app

```
			console.log("GOT PN", data);

```

});

---

<div class="post-metadata">

**Author:** ![gynekolog](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/gynekolog/32/96471_2.png) [@gynekolog](https://forum.ionicframework.com/u/gynekolog)\
**Post date:** [June 1, 2016, 3:05pm UTC](https://forum.ionicframework.com/t/push-notifications-problem-as-of-february-2016-new-problem-because-of-updating/42887/15 "2016-06-01T15:05:55Z")

</div>

> [@ihadeed](#):
>
> GCM Sender ID

Only little corection. Sender ID is not Project ID. Sender ID is project number.  
Project number is available at [https://console.developers.google.com/iam-admin/settings/](https://console.developers.google.com/iam-admin/settings/)
