django-push-notifications icon indicating copy to clipboard operation
django-push-notifications copied to clipboard

Registrion_id Dummy For Android

Open bobozar opened this issue 6 years ago • 9 comments

I've searched google for this but no success. How can I get a dummy registration_id for Android to test with django-push-notifications? I'm not a mobile developer, just want to use this package functionalities via API.

Any idea?

bobozar avatar Aug 07 '18 17:08 bobozar

If you look at the webpush section of the readme. You can use those code snippets to register your browser with FCM and retrieve a registration_id.

jamaalscarlett avatar Aug 07 '18 17:08 jamaalscarlett

Thanks for the reply. If I get your point, after generating the key, I should create a js file with the code on the readme section and replace with my private key generated? Then try and access the file to get my registration id?

bobozar avatar Aug 07 '18 17:08 bobozar

Correct. But the messages you send will only go to that browser instance. The registration id is not portable.

jamaalscarlett avatar Aug 07 '18 18:08 jamaalscarlett

Thanks for the reply. I generated the code and place it in the js file.. insert it in my html page and I load the page, nothing like registration_id was found. What am I missing?

bobozar avatar Aug 08 '18 10:08 bobozar

Do you get the pop-up asking if you want to allow notifications? If not, the service worker is not going to attempt to register to the back end server.

jamaalscarlett avatar Aug 08 '18 16:08 jamaalscarlett

No, I didn't get any.

bobozar avatar Aug 09 '18 10:08 bobozar

Let me look at the instructions again. Remember, if you are running this locally the connection needs to be SSL or FCM will not work.

jamaalscarlett avatar Aug 09 '18 15:08 jamaalscarlett

Ohh.. I'm not on SSL.

bobozar avatar Aug 11 '18 10:08 bobozar

If you are not using ssl on your server, it won't work. But you do not get any errors in the JS code.

jamaalscarlett avatar Aug 13 '18 13:08 jamaalscarlett