0

I'm trying to write some nodejs code to send a notification to an APN.[Apple push notification service]. I seem to have some control over the server code, but I need a device token from the client to get it.

I used this sample code http://samuli.hakoniemi.net/how-to-implement-safari-push-notifications-on-your-website/ To popup a notification, but this Method focusses on creating a pushpackage which again uses a certificate as opposed to an Authentication token.

Platform : MacOS Browser : Safari Method : Authentication Token/[Not certificates]

Need help with javascript code for extracting authentication token.

Umashankar Das
  • 601
  • 4
  • 12

1 Answers1

0

Ok the javascript code finally worked. I was able to get the device token using the same code.

My nginx server where I had the webportal hosted needed some tweaking. Basically, nginx has an user called www-data which did not have adequate permissions for me to write to a log file. I used the command

'addgroup www-data' to provide it necessary permissions.

If I may suggest use the createpushpackage.php to the t. It creates the perfect package and allows you to generate the permission dialogue properly.

Umashankar Das
  • 601
  • 4
  • 12