Ionic.io push notifications not received


#1

I am having trouble with Ionic.io push notifications. I can’t get the push notification to work in dev-mode or with real notifications for iOS and Android.

In dev mode I can see that the browser polls for new notifications correctly, but the push notification is never received by the client.

With “real notification”-mode the device (if iOS) asks the user for push permission. The device receives a token. However the push notifications sent is never received by neither iOS-devices or Android-devices.

I’ve checked the io API-key and APP-id and they’re correct.

If I check the status of the push notifications using the API, I can see that the push notifications have their state set to enqueued.

What could be wrong?


#2

Sorry, I can’t provide a solution. I’ve got the same issue. All my PNs are “state”: “enqueued”, have been since migrating to 2.0.0-beta.

Tokens are created fine. The device asks for permission to send notifications. Dev pushes are set to false.

A sample response:

curl -H "Authorization: Bearer MYAPIKEY" https://api.ionic.io/push/notifications

{"config": {"notification": {"message": "ASB recommends Daddy's Home (2015) because If you like Will Ferrell and Mark Wahlberg you'll enjoy this. Many people don't of course :p"}, "profile": "recprod", "tokens": ["85ec51c9a4b1d624557514fc523693c3464a65dc3529c1d4dee93cc399773911"]}, "uuid": "da8984f1-9b79-4790-b80e-3a877d6472bc", "state": "enqueued", "status": "locked", "created": "2016-03-29T02:53:04.088643+00:00", "app_id": "myAPPID"}

Cordova CLI: 6.1.0
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.0
Ionic Version: 1.2.4-nightly-1917
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
ios-deploy version: 1.8.5
ios-sim version: 5.0.3
OS: Mac OS X El Capitan
Node Version: v0.12.7
Xcode version: Xcode 7.3 Build version 7D175

Cordova iOS@4.1.0


#3

Could you attempt setting a notification to send 1-2 minutes in the future instead of instantaneously, then check if it works?


#4

Thanks for the suggestion. I tried this but they just went from “state”: “scheduled” to “state”: “enqueued” again.


#5

Since I wasn’t able to solve this within a reasonable timeframe, I went for a solution that didn’t include Ionic.io instead. I used the Cordova push plugin and set up an own backend for registering devices and sending push messages to APNS / GCM. Works great, and was done in like an hour.


#6

I’ve done the same this morning. https://github.com/Ph3nol/NotificationPusher/ to the rescue.


#7

@ablears @gildebrand @EffakT for what it’s worth, I had the exact same problem as @ablears. Glad to know it’s not just me for once, haha.


#8

So some days ago my token from my iPhone was always recognized as type: Android, now all my Pushes end up on state queued.

Is there something wrong with the 2.0.0-beta.0 ?

Is there any solution or fix?

I’m a big fan of Ionic as you know, but facing these challenges is something everyone hates and that scares everyone to use Ionic Push for Production. On my Blog I have about 130 comments only on Push notifications (see here), because nobody get’s this right…

The idea of Ionic.io and Push is great, but the feature should be a bit more reliable.


#9

I’ve got the same issue…


#10

I got the same problem. All my notifications have status: locked and state:enqueued.
I attached a sample below.

I sign up the user. I attache the profile, the device_token also, but none of my notifications were sent. I

My ionic version is 1.7.
https://api.ionic.io/push/notifications

{
“created”: “2016-07-03T01:38:52.829457+00:00”,
“status”: “locked”,
“state”: “enqueued”,
“app_id”: “XXXX”,
“uuid”: “YYYY”,
“config”: {
“profile”: “ZZZ”,
“notification”: {
“message”: “Hello world que nao funciona!”,
“title”: “Hi”
},
“user_ids”: [
“ZZZ”
]
}
},


#11

I am running into same issue over and over. I handle ionic push notifications in my 4 apps and its getting frustrating when it stop working without any reason. Ionic should streamline process to make it more clear to debug actual problem.


#12

Hello,
I have the same problem:

  • no notification arrives on android (only tested on android);
  • all notifications appear as
    – “state”: “enqueued”,
    – “status”: “locked”,
.................................................
.................................................
       {
            "app_id": "a37d6c52",
            "config": {
                "notification": {
                    "android": {
                        "message": "mobil_app_poc push notif test body",
                        "priority": "high",
                        "sound": "default",
                        "title": "mobil_app_poc push notif test title"
                    },
                    "ios": {
                        "message": "mobil_app_poc push notif test body",
                        "priority": 10,
                        "title": "mobil_app_poc push notif test title"
                    },
                    "message": "mobil_app_poc push notif test body",
                    "payload": {
                        "": ""
                    },
                    "title": "mobil_app_poc push notif test title"
                },
                "profile": "poc_security_profile",
                "query": {},
                "send_to_all": true
            },
            "created": "2016-09-12T12:33:56.756085+00:00",
            "state": "enqueued",
            "status": "locked",
            "uuid": "632d4c91-a17e-49de-862b-e9512ed80723"
        },
        {
            "app_id": "a37d6c52",
            "config": {
                "notification": {
                    "android": {
                        "message": "mobil_app_poc push notif test body",
                        "priority": "high",
                        "title": "mobil_app_poc push notif test title"
                    },
                    "ios": {
                        "message": "mobil_app_poc push notif test body",
                        "priority": 10,
                        "title": "mobil_app_poc push notif test title"
                    },
                    "message": "mobil_app_poc push notif test body",
                    "payload": {},
                    "title": "mobil_app_poc push notif test title"
                },
                "profile": "poc_security_profile",
                "query": {},
                "send_to_all": true
            },
            "created": "2016-09-12T12:20:01.168557+00:00",
            "state": "enqueued",
            "status": "locked",
            "uuid": "26131483-1406-40e9-abb8-70f0f4fea3f0"
        }
    ],
    "meta": {
        "request_id": "6eb3878b-331c-4a51-85c4-8e3633e4a8e8",
        "status": 200,
        "version": "2.0.0-beta.0"
    }


#13

hello @gildebrand,

Is it possible to post some code examples/configuration on how you did this ?
Would be very helpful.
Thank you any way.


#14

I have had this same problem and even emailed tech support with no response! A working example would be awesome!

Robert


#15

I could post my solution later today! To bad Ionic hasn’t done anything about this…


#16

@gildebrand Thanks. That would certainly help a few people I’m sure!

RGecy


#17

@andrei_diaconescu @rgecy I wrote down some instructions over here: https://github.com/gildebrand/Ionic-push-notifications
Hope they help you :slight_smile:


#18

thank you very much !


#19

@gildebrand Thanks for the code. I actually got push notifications up and running using the new ionic.cloud setup tutorial. Before I was still using the web-platform. The new ionic docs on this seem much easier.

Thanks again,

RGecy


#20

I have the same problem, as I can see this is a problem of Ionic or not?
someone tried to use a more stable service?

this is the response:
“created”: “2016-10-26T15:57:45.723764+00:00”,
“app_id”: “5552ea49”,
“status”: “open”,
“state”: “enqueued”