Ionic1 Push Notification by using Ionic IO Services

Hi Everyone,
I know there are plenty of references already available to implement push notification from scratch. It seems simple initially but i have got stuck in between and not able to decide where is is issue in my approach to implement push notification in ionic 1.

I have used below references for building my sample app

  1. I have set my GCM Project and API Key on Google Cloud
  2. I have set my security profile using the same GCM API key in Ionic IO.

I have my app running in browser which have generated and displaying the device token.

Now i am trying to send Ionic Push messages from ionic io but all the messages are going in send state and none of them status is changing.

I have even tried to publish by using a sample node js script or by using PostMan pluggin but its failing with below error :

HEADERS: {“connection”:“close”,“server”:“nginx”,“date”:“Wed, 14 Sep 2016 03:36:5
5 GMT”,“content-type”:“application/json; charset=utf-8”,“content-length”:“196”,“
via”:“1.1 vegur, 1.1 vegur”,“access-control-allow-credentials”:“true”,“access-co
BODY: {“meta”: {“request_id”: “87cae260-72cb-4138-8737-0cb23e6d425e”, “status”:
401, “version”: “2.0.0-beta.0”}, “error”: {“type”: “Unauthorized”, “link”: null,
“message”: “JWT decode error occurred.”}}

Here is the node script :

var ionicPushServer = require(‘ionic-push-server’);

var credentials = {
IonicApplicationID : “48e8672d”, // app_id
IonicApplicationAPIsecret : “9e330522a91be8a2714a52371e4b94d13a4d9a074cab8b5e” // io

var notification = {
“alert”:“Hi from Ionic Push Service!”,
“expiry”: 1423238641,
“priority”: 10,
“contentAvailable”: true,
ionicPushServer(credentials, notification);

I am not sure how do i trace whether the issue is

a. between Ionic Push and GCM
b. or From GCM to My application

I want to first verify the demo in my web browser to see if i am able to publish from Ionic Push > GCM > My application (or phone)

Need any help if there is a better way to test this flow. Sorry for asking the same steps again

Hi All,
Able to resolve the issue. It was problem with the request parameter using Curl or PostMan.

Able to publish notification on my real device.

  1. Now the issue is the notification comes only when the app is open

  2. After changing the dev_push=false, my browser giving error as : Uncaught TypeError: Cannot read property ‘init’ of undefined

I believe this error lot of people have experienced it. so searching now to resolve this issue

Rohit Gupta

What was the issue with request parameter. Can you provide screenshot of correct postman request?

Here is my current postman setup. I am using “external_ids” as an identifier, so you probably want to change this to your needs.





Hi Edward,
I am trying to do a very simple push-
see below image

But it shows message as below -

Could you please suggest possible issues-

Hm. Your settings seem to be correct. You might want to check the “Authorization”-Tab in Postman (next to Headers) if this is set to “No Auth”.

However, i think this has to do with your certificates, so maybe you want to consider going through the whole process one more round and follow these steps:

Hi Ed,
Thanks for the reply…
Auth type was set to No Auth so no worries from that point of view.
Anyways I have solved the issue by modifying the postman request, as request param were not getting recognized in service until it was mentioned specifically in Headers tab…

Thanks for your time… I appreciate your efforts to help me.

Hi Basu,
I’ve same problem, Can you tell me how to fixed it in more detail ?


Hey Donc1991,

I resolved the issue by removing parameters(content-type and authorization) from the param section of postman and then added those parameter to the headers section and it worked.