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

Device ID does not accept Apple devices (iPhone for example)

Open gabn88 opened this issue 8 years ago • 10 comments
trafficstars

The FCM deviceID now only accepts Android devices. This, while it is certainly possible to send push notifications to Apple devices using Google's FCM service.

I know it is possible to leave this field empty, but 1. it took me some time to find out why push notifications weren't working on iOS and 2. There is not good reason to only accept Android Device IDs.

gabn88 avatar Oct 19 '17 14:10 gabn88

When FCM was added, I believe it was as an update to GCM which will be phased out at some point. But you are correct, FCM does allow for push notifcations to be sent to IOS devices. Feel free to submit a pull request :)

jamaalscarlett avatar Oct 20 '17 02:10 jamaalscarlett

This may be fixed by https://github.com/jleclanche/django-push-notifications/pull/386

jamaalscarlett avatar Oct 21 '17 03:10 jamaalscarlett

Issue #386 needs more testing to determine how it behaves with existing data. I am particularly concerned with how drf api calls would translate old ids. It may be hard to preserve backwards compatibility here.

On Oct 20, 2017, at 11:50 PM, Jamaal Scarlett [email protected] wrote:

This may be fixed by #386

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

matthewh avatar Oct 21 '17 11:10 matthewh

Backwards compatibility? I would say, just make a CharField of it. Of course it would be cool to validate against both the spec of Android and Apple, but I cannot find a hard spec on the device id for both? Validation is also possible on a CharField and at least this is forward compatible, which a UUID field probably is not (if it is even compatible with all existing device IDs).

gabn88 avatar Oct 23 '17 13:10 gabn88

I don't disagree with you @gabn88 but @jleclanche has generally disapproved of converting the Device ID field to a CharField.

matthewh avatar Oct 23 '17 20:10 matthewh

Go for it.

jleclanche avatar Oct 23 '17 22:10 jleclanche

Has this been fixed? I was thinking to use this app for implementing push notifications for our ios and android apps via fcm with a django backend. Please advise.

uber1geek avatar Nov 16 '17 11:11 uber1geek

Just go for this module and leave the deviceID field empty on ios for now.

gabn88 avatar Nov 16 '17 12:11 gabn88

Any news about this? I run into this problem because UIDevice.current.identifierForVendor.uuidString returns a UUID while GCMDevice wants an HexInteger.

sevdog avatar Dec 05 '19 12:12 sevdog

Any update on this, because I need to save iOS device ID

sainipray avatar May 12 '23 07:05 sainipray