Closed armandzwan closed 7 years ago
A quick hack for that is to add it to the push implementations. I added it for testing in the folder "pushservices" in the file apns.py (for Apple Push) and added there the marked line:
item = {} item['content-available'] = 1 <----- this line added, around line 82 if self.sound is not None:
After that my push msg on the app looks like this:
2016-05-28 17:23:44.512 Patchwork[2182:774177] ----- Did receive remote notification: { aps = { alert = ""; "content-available" = 1; sound = ""; }; }
I have yet no idea what to change for Android.
I submitted a pull request with changes made to implement support for content-available. In the JSON sent in the POST request to AirNotifier, add a new key-value pair:
"content": 1
This will be changed to the proper flag for the APNs.
The pull request was accepted and this feature has now been implemented.
Thanks guys!
With APNS you can sent silent notifications. For it to work, we need to set "content-available" : true
in the "aps" dictionary for example:
can this be added?
See Table 5-1 https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW2