I'm using this plugin to send push notifications from my Django REST app.
https://github.com/xtrinch/fcm-django
It works fine for the android side but IOs are unable to receive any notifications. Can anybody please tell me what I'm I missing here.
Following are my fcm_django configurations:
FCM_DJANGO_SETTINGS = {
"APP_VERBOSE_NAME": "app-name",
"FCM_SERVER_KEY": "<firebase-server-key>",
"ONE_DEVICE_PER_USER": True,
"DELETE_INACTIVE_DEVICES": False,
}
Following is my code which I use to send a notification to a device:
data = {
"title": 'New Notification fired',
"body": 'I just fired a new notification'}
devices.send_message(data=data)
It results in the following success response:
{'multicast_ids': [1212322313231212], 'success': 1, 'failure': 0, 'canonical_ids': 0, 'results': [{'message_id': '0:1579690926842318%a93f219bf9fd7ecd'}], 'topic_message_id': None}
Any help in this regard is highly appreciated. Thank you for your time.
I have faced the same problem , there was an issue in this repo I managed to try some solution from it
this solution works good for me
try this I am sure it will work as I am using in all of my projects
then enhance it with this
edit "more clarification"
In iOS, to provide a background notification, the JSON sent to firebase MUST have a key "content_available" : true and other issue there is no sound on notification. this is my working json with sound and background notification for iOS.
just try to send a post request with that body using postman with this url https://fcm.googleapis.com/fcm/send this will do what fcm-django do
priority(also from the docs):as mentioned here Firebase messaging - whats "content_available" : true also you can read the docs for more information