I am also experiencing what I believe is the same issue as @gurjit_onebcg. Fundamentally, the issue is that there is a large delay of 30 minutes to a couple of hours between when a push notification is registered with the Ionic Push Service create API and the time that the notification registers on a target device. This does not occur when creating a push notification from the ionic dashboard.
The create API response shows the same data as indicated by @gurjit_onebcg in his previous response, primarily, “state” : “enqueued” and “status” : “locked”.
REQUEST
var body = {
"external_ids": "111",
"profile": "myprofile",
"notification": {
"title": "Test Push",
"message": "Yet another push message scheduled"
}
};
http method="post" url="https://api.ionic.io/push/notifications" result="response" {
httpparam type="body" value="body";
};
RESPONSE
{
"data":{
"status":"open",
"config":{
"external_ids":[
"111"
],
"profile":"myprofile",
"notification":{
"message":"Yet another push message scheduled",
"title":"Test Push"
}
},
"state":"enqueued",
"created":"2017-06-16T22:55:06.125950+00:00",
"uuid":"xxxx-xxxx-xxxx-xxxx-eb404b3f6056",
"app_id":"xxxxxx"
},
"meta":{
"request_id":"xxxxxx-xxxx-xxxx-xxxx-c388aafdacac",
"version":"2.0.0-beta.0",
"status":201
}
}
Immediately after creating a push notification calling the Get Notifications API returns a list which includes the notification generated in the previous create API. The state of this notification remains “state” : “enqueued”.
{
"meta":{
"status":200,
"request_id":"xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx",
"version":"2.0.0-beta.0"
},
"data":[
{
"config":{
"profile":"myprofile",
"external_ids":[
"111"
],
"notification":{
"title":"Test Push",
"message":"Yet another push message scheduled"
}
},
"status":"locked",
"state":"enqueued",
"app_id":"xxxxxxx",
"uuid":"xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx",
"created":"2017-06-16T23:03:41.557491+00:00"
}
]}
A subsequent call to list notification messages returns a list of messages created for the previous notification. Each of the messages has a “status”: “sent”, yet the messages are still not received on the target device for times ranging from 30 minutes to a few hours.
{
"meta":{
"version":"2.0.0-beta.0",
"status":200,
"request_id":"xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"
},
"data":[
{
"notification":"xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
"status":"sent",
"uuid":"xxxxxxx-xxxxx-xxxx-xxxx-xxxxxxx",
"error":null,
"created":"2017-06-16T23:03:41.786952+00:00",
"token":{
"token":"dzJv-4ZPkrM:APA91bfgjghFo2eL1Ca4DPGTnjbdwv6TT1Xd8Zfd--eNqgdGDg5rt1e4hjhjrEceVGvm5ydBrnT015SeYvBVZFzXUEAcZTaq9DE6Vpt2OjFjaWitBkvhQoWDRW5tigFz4qUZNyXd-MVY6a9msjyU2",
"valid":true,
"invalidated":null,
"created":"2017-06-16T18:39:15.927269+00:00",
"id":"xxxxxxxxxx",
"app_id":"xxxxx",
"type":"android"
},
"user_id":"xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx"
}
]
}
Calling the message retrieve API returns the message information. The message has “status” : “sent” as would be expected from the previous API.
{
"data":{
"notification":"xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
"user_id":"xxx-xx-xxxx-xxxx-xxxxxxxx",
"status":"sent",
"uuid":"xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
"created":"2017-06-16T23:03:41.786952+00:00",
"error":null,
"token":{
"token":"dzJv-4ZPkrM:APA91bFo2edfg46534Ds4L1Ca4DPGTnjbdwv6TT1Xd8Zfd--eNqgdGDg5rt1e4rEceVGvm5ydBrnT015SeYvBVZFzXUEAcZTaq9DE6Vpt2OjFjaWitBkvhQoWDRW5tigFz4qUZNyXd-MVY6a9msjyU2",
"invalidated":null,
"id":"e3c847ab2sasd43sd327ea4d378a5cf49535a1477",
"created":"2017-06-16T18:39:15.927269+00:00",
"type":"android",
"valid":true,
"app_id":"xxxxxx"
}
},
"meta":{
"version":"2.0.0-beta.0",
"status":200,
"request_id":"xxxxx-xxx-xxxx-xxxx-xxxxxxx"
}
}
NOTES
- Using the ionic dashboard to generate a push notification immediately deploys the notification to a target device.
- I am using an android device for my testing of received push notifications
- I use custom auth in our application and send targeted push notifications via the external_id