Push notifications stopped to work


#1

Hello,
I had my push notifications working for months, and now I migrated it to the last ionic.io version. Now I have this return from my calls to push endpoint :

    { data:
       { config: { tokens: [Object], notification: [Object], profile: 'main' },
         uuid: 'some-long-universal-unique-id',
         app_id: '39f1dcf4',
         state: 'enqueued',
         created: '2016-10-25T13:13:57.079603+00:00',
         status: 'open' },
      meta:
       { request_id: 'some-long-request-id',
         status: 201,
         version: '2.0.0-beta.0' } }

On the client side I migrated as well of course :

$ionicPush.register().then(function(t) {
    return $ionicPush.saveToken(t, { ignore_user: true });
}).then(function(t) {
    console.log('Token saved:', t.token);
});
$rootScope.$on('cloud:push:notification', function(event, data) {
    console.log(event, data);
    var payload = data.payload;
    console.log(payload);
});

I’m using restler to send this from my server : https://github.com/danwrong/restler . I don’t think there is an issue with the user’s token. On the device console.log I have the same that is used on the server side. But ultimately the device doesn’t receive anything.

Thanks ahead for helping !


#2

I have the same problem, I don’t know what to do.

I use Ionic Cloud and I have been using the push notification service of ionic and FCM and today this don’t work

this is the response:

{
"data": {
"uuid": "XXXXXXXXXXX",
"config": {
  "notification": {
    "message": "MESSAGE"
  },
  "profile": "XXXXXXXXXXX",
  "tokens": [
    "XXXXXXXXXXX"
  ]
},
    "created": "2016-10-26T16:14:30.924182+00:00",
    "app_id": "5552ea49",
    "status": "open",
    "state": "enqueued"
},
"meta": {
   "version": "2.0.0-beta.0",
   "status": 201,
   "request_id": "XXXXXXXXXXX"
}
}

#3

Hello @JerryBels you succeeded in sending push notifications?


#4

Nope, still not. It’s been several days now that I fail to make it work. It’s really frustrating !


#5

I understand you, this is so frustrating , if I find some solution I will write you.

I read old posts and seems this problem to happend before, May be it’s a good idea use other service to send push notifications


#6

Found the problem for me. The sender_id was mismatch. You can check what is the problem by taking one notification_id and calling this endpoint with it : https://api.ionic.io/push/notifications/notifId/messages !

Good luck to you too !


#7

good!! I could not even solve this problem

I have calling to this endpont https://api.ionic.io/push/notifications/NOTIFICATION_ID/messages and this is the response:

{
   "meta": {
      "version": "2.0.0-beta.0",
      "request_id": "XXXXXXXXX",
      "status": 200
   },
   "data": [{
      "created": "2016-10-27T00:58:57.017693+00:00",
      "uuid": "XXXXXXXXX",
      "user_id": null,
      "notification": "XXXXXXX",
      "token": {
          "created": "2016-10-11T06:06:45.580377+00:00",
         "app_id": "XXXXXXX",
         "invalidated": null,
         "id": "XXXXXXXXX",
         "token": "XXXXXXXXX",
         "valid": true,
        "type": "android"
       },
       "error": null,
       "status": "sent"
     }
  ]
}

All seems ok in the response, but the push notifications is not received in the devices, I’m very frustrating

Help Please!!!


#8

Hello, sorry I didn’t see that before,

if this is what’s appearing the only thing I could think of is a mismatch between device’s token and the token you use to send the notification. Try and console.log both of them (one on the client the other on the server of course) and check if they match.


#9

hi, i currentely have push sort of working for me. I have receive push and see the push msg after i reinstall the app from CLI. But looks like, after some times, i have sens my push, but i cant receive on my device.

is it has any expiry time on each device token? or because i use the dev push true mode, this coz the not receiving push issue?

any idea? thanks.


#10

I remember reading in the docs that dev_push has been removed. It could help you to try and follow those migration guides. Good luck !


#11

hi, @JerryBels, really thanks for the tips. Gonna try this out.