on 07-23-2015 11:31 AM
Hi all,
i have developed a kapsel push notification cordova based app which is linked to my HCPms cockpit and i followed the below document to develop.
and
App successfully registered with HCPms, and i could see the APP registred ID in cockpit : ed0f5105-2bc4-4xxxc5-axxx-bxxxxxxxxxxx,
where the others requirements are as follows
API Key : AIzaSyAxxxXXXOo0OC0npExxx4XaD8tHCqvBQxx
Sender ID : 2982XXXXXXXX
Notification user has been assinged in the HCPms.
Turned on push service in GCM.
APPCID : ed0f5105-2bc4-4xxxc5-axxx-bxxxxxxxxxxx.
Android.Manifest file has been configured correctly by adding required permissions and plugins
Now i am able to register and unregister from my HCPms cockpit but could able to send the push notification to my app on android device.
the below is the url i found to trigger the notifications on my HCPms.
https://hcpms-pXXXXXXXXXtrial.hanatrial.ondemand.com/Notification - which is mentioned in my HCPMS
but when my device is registered i am got as
So what is the exact way to trgger the notification and did i missed any thing else.
I tried the above one and tried other ways to trigger using REST client but couldnt able to get succeed and i am getting "403 FORBIDDEN" error .
1. Install POSTMAN in your Google Chrome browser.
2. Start POSTMAN. Adding True Mobile Capabilities 12.6 © Rheinwerk Publishing, Boston 2015 49
3. Select Basic Auth.
4. Enter your SAP HCP user credentials.
5. Select Post as the HTTP Method to Execute.
6. Select the destination URL: https://hcpms-trial.hanatrial.ondemand.com/restnotification/application/com.hcpbook.hybrid This URL format is used to notify all users of the specified application. (Note: The synopsis of your SAP HCPms application definition shows a push URL, but it is not quite correct in the current release of SAP HCPms; replace /Notification with /restnotification as shown previously.)
7. Add a Content-Type HTTP header; set the value to application/json.
8. Select Raw and JSON for Content Type.
9. Add the following payload message text: {"alert":"Your latest meme is available for review", "data": "foo" }.
10. Click Send.
So can any one help me out what the exact way to trigger the notification to my registered device.
pls find the attached images to get clarification.
Hi Saikiran
Please note the below steps when you are testing the push notifications with HCPms.
I have tested push against HCPms and found it working with an android device version 5.
Regards,Midhun
SAP Technology RIG
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Midhun ,
Firstly thanks a lot for the response.
Last time itself i have followed each and every step exactly as u mentioned above and my API Key(Server) is shown in the attachment. Is that right? Presently i am facing problem with my HAT ,so as soon as it got fixed i will try to cross check the above all and say you where i got strucked.
Hi Saikiran,
Is it working now ?
You could have a look at this blog to get more details: http://enterprisemobilityblog.com/android-push-notifications-with-hcpms/
Regards,Midhun
SAP Technology RIG
Hi Midhun,
I have done every thing again with latest SDK and followed each and every step perfectly but still no luck.
My main problem is to trigger a notification from the rest call. I am new to that REST call. I am getting 405 error if my url is as below
firstly how would i know that my device is registered using GET ?
and what all the headers i need to pass?
do i need to pass AppCID? if so how would i get using rest call?
i have tried various ways
And my mobile giving the registration info as
And when i click register for push its giving the id as
So how can i trigger the notification using REST .why i am getting the 405 error .
By looking at last screenshot, its clear that your device has been registered with GCM server. In fact, you can verify it using REST client,
Make a GET request,
hcpms-<SCNuserid>trial.hanatrial.ondemand.com/odata/applications/latest/com.test.hcpms/Connections('x-smp-appcid value')
Header: X-SMP-APPCID: value
in the RESPONSE, you would notice the same GCM Registration ID for the parameter 'AndroidGcmRegistrationId'
then to send/trigger a notification from the REST client, request a POST
Headers:
Authorization: SCN id and password
content-type:application/xml
<<please share the Request Header screenshot if still you dont get the notification>>
Regards,
JK
Hi JK,
Thanks for the response. I got the status 200(OK) for GET but i didnt get the AndroidGCMRegistrationID as of your screen shot, I got the response as shown in the below figure.
And when i tried to triggered notification i got the response as status 200, but i didnt get any notification. And how would i know that a notification has been triggered successfully through response headers. The following is the POST request screen shot .
i think i am near to get it work ,so pls help me out.
Hi JK,
Now i am using the postman REST so i for the GET request i got the GCM ID as shown in the below attachment.
Now when i did the POST request i am getting the status 200 but it is giving the error as "your browser doesnt support java script ", i checked it in my browser setting it is perfect and enabled for all sites.the following is the attchement for the post request.
and i have assigned the notification user in the SAP HANA Cloud Platform Mobile Services too as shown in the below attachment.
and i have kept the "gcm.jar" in my libs folder too so what would be my problem to trigger the notification.
regards,
Saikiran Bommagowni.
The content within a noscript tag will be displayed on the screen if the browser does not have JavaScript enabled. I believe you are seeing that because you are looking at the HTML that has not been rendered.
The one thing I noticed is that the Content-Type header is not set to application/json.
Hope that helps,
Dan van Leeuwen
Hi Saikiran,
What I could notice is that the url you are using is wrong. You should not add the word admin in the URL. Please follow the below url format.
Regards, Midhun
SAP Technology RIG
Hi midhun,
I am getting the response as below.
{
"status": {
"value": "OK",
"code": 0
},
"results": [
{
"status": {
"value": "Unknown push target type",
"code": 2
},
"registrationId": "ae0efb76-bcb2-4011-898e-531eb98fd60b"
},
{
"status": {
"value": "Unknown push target type",
"code": 2
},
"registrationId": "f999d271-ce96-4b82-8609-94b52734b2b3"
},
{
"status": {
"value": "Unknown push target type",
"code": 2
},
"registrationId": "3eab9bd4-888f-4781-9a6a-e007dfb6db66"
},
{
"status": {
"value": "OK",
"code": 0
},
"registrationId": "81ee087b-0bb5-48f4-9766-729bd6db1c4e"
},
{
"status": {
"value": "OK",
"code": 0
},
"registrationId": "5c5aa9b1-cd3a-494d-9d0c-424db5ae7471"
}
]
}
Hi Midhun/Jitendra,
Thanks a lot for your help ,now i am able to get the notifications successfully on my device with SMP SDK SP08 . Now i will try for the SMP SP09 SDK and also with SMP local server rather than HCPMS cloud server. Sorry for the late reply as was involved in some other work so i couldn't able to work on the notifications.
Regards,
Saikiran Bommagowni.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
but when my device is registered i am got as
please check again, It should be
This one is just a response for the POST request (register an user/on-boarding a device).
What happens when you try with below URLs
https://<HMC base URL>/restnotification/application/<applicationId>
https://<HMC base URL>/restnotification/application/<application ID>/user/<username>
I also suggest you to make a GET request to this URL
Header: x-smp-appcid:<value>
and check the response , do you see a value for AndroidGcmRegistrationId parameter?
Regards,
JK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
can any one help me to figure out this problem
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.