cancel
Showing results for 
Search instead for 
Did you mean: 

Push Notification for native ios?

Former Member
0 Kudos
550

Hi Everyone,

I followed the below link to register the APNS token to SMP server.But when im testing the application with rest client im not get the notifications.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e058f6ca-6b58-3210-d0a6-c69ae1872...

When i test on rest client ,im getting the respose as 201 created.But im not getting the notification.


Please help me where im going wrong.

Thanks,

Praveen.

View Entire Topic
Former Member
0 Kudos

Hi Praveen,

One more check.

Once you have onboarded your device in the server, you can use restclient to check whether the ApnsDeviceToken is registered with server.

URL : http://<server>:<port>/odata/applications/latest/<appid>/Connections('<x-smp-appcid>')

Headers :

Method : GET

X-SMP-APPCID : <value>

You will be able to see the ApnsDeviceToken in the response.

Also you should pass the username and password of your Notification Security Profile while sending the notification from restclient.

Regards,

Dhani

Former Member
0 Kudos

Hi Dhani ,

I got the response with APNS token.Do i need to look any configuration in cockpit?

Thanks,

Praveen.

Former Member
0 Kudos

Hi Praveen,

Once you have set the certificate and password, you need not have to do any configuration in the server.

Did you try the telnet command to see whether the required ports are open?

Regards,

Dhani

Former Member
0 Kudos

Hi Dhani,

What are the ports we need to open?if im not wrong we need to open the 5223 port?

Thanks,

Praveen.

Former Member
0 Kudos

Hi Praveen,

According to Apple document the ports 2195 and 2196 should be opened and port 5223 should be opened if you are using Wifi. You can refer to the troubleshooting guide Technical Note TN2265: Troubleshooting Push Notifications to confirm whether you have done everything properly in the server end.

Meanwhile, can you try sending notification using the url

http://<server:port>/restnotification/application/<appid>/user/<username>

Header:

Content-Type :  application/json

Basic Authentication: Notification security profile username & password

Method : Post

Your response should contain the registration id of the device to which the push notification was sent.

Regards,

Dhani

Former Member
0 Kudos

Hi Dhani,

I tried to check the response for the above url,with payload

  1. {
    "alert": "TravelAgencies",
    "data": "Notification to all devices registered to a user", "sound": "default"
    }

im not getting the registration id of the device .

But when i run the url with appid and post the data then im getting the registered id for that application id.The below is the screen shot with only application id.

Thanks,

Praveen.

Former Member
0 Kudos

Hi Praveen,

This means your request is reaching the SMP server. Are you getting anything in Log regarding Push?

Regards,

Dhani

Former Member
0 Kudos

Hi Dhani,

No,im not getting anything in the push log .

Thanks,

Praveen.

Former Member
0 Kudos

Hi Dhani,

Im checking the logs like below screen.

Thanks,

Praveen.

Former Member
0 Kudos

Hi Praveen,

Can you change the Log Status from ERROR to INFO and try?

Also, from restclient make a try with URL in the following format:

http[s]://<host:port>/Notification/<application connection ID>?alert=<alert>&badge=<badge>&sound=<sound>&data=<data in text format>

(In this case, no need to pass anything in the request body)

More ref: SAP HANA Cloud Platform Mobile Services

Regards,

Dhani

Former Member
0 Kudos

Hi Dhani,

I changed the log status from ERROR to INFO ,still i can't see any log for my application.

even i tried with the belpow link the restclient ,and getting the response is 0.

http[s]://<host:port>/Notification/<application connection ID>?alert=<alert>&badge=<badge>&sound=<sound>&data=<data in text format>

Thanks,

Praveen.

Former Member
0 Kudos

Hi Praveen,

Can you please increase the timeframe of the Log and try once with the url where you were getting registration id in the response?

Regards,

Dhani

Former Member
0 Kudos

Hi Dhani,

Im getting the log now ,below the screen shot.

When i open view trace it shows like this.

Please help me out.

Thanks,

Praveen.

Former Member
0 Kudos

Hi Praveen,

Do you mind increasing the log level to debug and checking once again?

Regards,

Dhani

Former Member
0 Kudos

Hi Dhani,

How to increase the log level?

Thanks,

Praveen.

Former Member
0 Kudos

Hi Praveen,

In your SMP server, go to

Logs - Settings - Push

I have added the screenshot in one of the comments above.

Regards,

Dhani

Former Member
0 Kudos

Hi Dhani,

After checking the log im getting  the below error.

Thanks,

Praveen.

Former Member
0 Kudos

Hi Dhani,

Thank you,for your time and quick response .Now im able to get the notifications on the device.

This is due to ports are closed at server end.

once again thanks .

Praveen.

0 Kudos

Hi Dhani,

I followed all the steps suggested by you. I even get the Notification processing in SMP Logs. But i am not getting any notification on my IPhone device.

Please help. I have raised a discussion here:

Thanks,

Tasneem KW