Push won't work after cloud migration

I performed the migration to the new version of Ionic services (cloud).
All works fine exept the push notification, while the device still receive the notification, but I’m not able to handle it as described into migration docs with $on (

$scope.$on(‘cloud:push:notification’, function(data) {
var msg = data.message;
alert(msg.title + ': ’ + msg.text);
// never called

Dens anyone had this issue?

Maybe I found the problem but not I can’t test it.
I found the github migration guide on

And it is different method to handle the notification
$ionicEventEmitter.on(‘push:notification’, function(data) {

While the other method I fond it here

So is it a documentation error?

1 Like

Not from a migration point of view, but just using the new Ionic Cloud push notifications service setup in the docs I’m not receiving any notifications either, and it seems to have a caught up a couple other people since I found this other post on the forum:

I’ll definitely post something if I figure it out, or find a solution.

Good answer, i try, and tell you later

ionicEventEmitter.on(‘push:notification’, function(data) { console.log(data.message);});

I solved like this.

Sorry i cant solved, where put this code, in an controller, services, factory, where, help me pls

I have the same problem.

My app was Ionic version 1 and the notifications worked well, I followed all the migration steps, and it works only when the app is closed/background.

My app is Ionic 1, I updated to the latest CLI 2.0.0, delete all references to the ionic-platform-web-client.

I place the listener to the ‘cloud:push:notification’

$scope.$on(‘cloud:push:notification’, function(event, data) {
var msg = data.message;
alert(msg.title + ': ’ + msg.text);

Use this different method to handle the notification on my controller, or where I have to put this method ?:

$ionicEventEmitter.on(‘push:notification’, function(data) {

After trying all this, nothing works for me, does anyone have any solution?

Make sure the Cloud Client is up to date (and you’ve copied the latest distribution file into your www/lib folder). The latest version is 0.9.0.

If you’re still having problems, try posting an issue in our repo so we can help!

Is it $scope.$on(‘cloud:push:notification’,…) OR $ionicEventEmitter.on(‘push:notification’…)? If it is the latter then where is $ionicEventEmitter declared? I looked in the ionic.cloud.js (v0.9.0) and I do not see it. Not sure what the answer is here. Anything conclusive to share? Thanks!