-
Notifications
You must be signed in to change notification settings - Fork 436
Description
We have been trying for the last two weeks to get a reliable solution to try and sync our app data with a server in the background. We have tried the Background fetch mechanism but due to the iOS restrictions on when it runs it is not a viable solution.
iOS does provide Remote Notifications (https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app?language=objc) that we would like to use as we can use the same mechanism on Android.
The issues is that when sending a type 2 notification CN1 only delivers the notification when the app is brought to the foreground by the user.
On Android I see there is a Build Hint for android.background_push_handling that allows the notifications to be sent to the app even if it is in the background.
Is there a similar build hint that we can use for iOS?
If not, is there a way then to override the application:didReceiveRemoteNotification:fetchCompletionHandler: method that fires when the Notification arrives so that we can forward it to our app?
Turns out we already support the content-available: 1 mode in the push server and use it by default when sending a #2 type push message. We're still missing a callback in our delegate so it would work but that should be a relatively easy fix. Please file an issue and we'll try to address it within the next couple of weeks: github.com/codenameone/CodenameOne/issues – Shai Almog Oct 8 at 2:01