cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in Push notification

KishoreKumarV
Advisor
Advisor
0 Kudos

Hi ,

I am new to HCPms and I am trying to develop the push notification with kapsel using WebIDE, I am not getting any response back from the following method.

               var nTypes = sap.Push.notificationType.SOUNDS |                     sap.Push.notificationType.ALERT;

            sap.Push.registerForNotificationTypes(

            nTypes,

            function(result) {

                alert("result");

                alert("Successfully registered: " + JSON.stringify(result));

            },

            function(errorInfo) {

                alert("errorInfo");

                alert("Error while registering.  " + JSON.stringify(errorInfo));

            },

            function(notification) {

                alert("in processNotification: " + JSON.stringify(notification));

            },

            "sender id");

No alert is been thrown, none of the three mentioned callback is been called , not sure whether the application is registered for push and when i try to check from rest client by post request to push url, I am getting 403 forbitten error, Kindly help.

Thank you

Rottwei

Accepted Solutions (1)

Accepted Solutions (1)

KishoreKumarV
Advisor
Advisor
0 Kudos

Hi Midhun & Jitendra,

Thanks a lot, The issue is resolved. It was becoz of Gcm.jar library not loaded properly and the Server API key Authorization issue.

Rottwei (Kishore Kumar)

Answers (2)

Answers (2)

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Rottwei,

Before sending push notification you can check if device has registered at GCM.

Make a call in REST client

Request:

http://smpserverhostname:8080/odata/applications/latest/appid/Connections('appcid')

GET method

Header: content-type : application/json

            

Response:

midhun_vp
Active Contributor
0 Kudos

Hi Rottwei,

If the registration is successful it should go to the successCallback function otherwise it goes to errorCallback. You could debug code using Chrome - http://java.dzone.com/articles/debugging-android

The sender ID should be your project number from google developer console. If the push registration is successful you could test it from REST client.

Regards,Midhun

SAP Technology RIG