Closed elad823 closed 5 years ago
Is data message sent as silent notification to IOS? If yes thats can explain it:
Important
The system treats silent notifications as low-priority. You can use them to refresh your app’s content, but the system doesn't guarantee their delivery. In addition, the delivery of silent notifications may be throttled if the total number becomes excessive. The actual number of silent notifications allowed by the system depends on current conditions, but don't try to send more than two or three silent notifications per hour.
right, use notification
rather than data
for reliable notification in iOS
Ok thanks. But even when i use notification, I still have issue when the app is closed:
In my app when a notfication of a new message arrived, the message should be saved to the local db whether or not the user has opened the notification.
So in a case where the app is closed , the notification do presented , but no event is called. How can I handle this case and save the message to the db?
for iOS, when notification arrives with content_available:true
, it will wake JS and callbacks will be executed if they are not registered in a component.
however, if user force kill the app, there is no way to run logic until app is opened by user again. system limit
@evollu thank you for an incredible library. Ive benefited so much. Of note, using firebase to send push notifications I had to leave out content_available
entirely to avoid errors. upon removal everything was working great. I needed it to allow people to reply to messages from the notification tray (iOS). I run a database save (it is a promise). This works even if the app is killed in my experience. Again, many thanks. If needed i hope to contribute my thanks with code as well. such a good library.
Hi, I am not receiving data messages in some cases to the IOS device. My server sends data messages with content_available:"true". My expected results when an notification arrived are : 1) Save the data 2) Present a tray notification if the app is in one of the 3 states: killed, background, foreground but not in the right screen.
My actual results are: 1) When the app is killed the notification never arrives or presented. 2) When the app is in background : the first 9 notifications arrives and presented as expected, then the next notifications are not presented , but when i open the last one that was sent id presented. If I wait about 30 minutes in background state , I can receive again just 9 notifications. 3) When the app is in foreground the notifications arrives and presented as expected 4) Sometimes I get twice or even 4 times the same notification.
Here is my code:
And here is an example of the notification received from the server:
Thanks Elad