cordova-plugin-code-push
cordova-plugin-code-push copied to clipboard
Sync on push notification in background possible?
Description
Is it possible to sync from android native code in the background without the app running? For example from the onMessageReceive handler of FCM?
See also https://github.com/Microsoft/react-native-code-push/issues/1233
I definitively second this idea. It would nice to be able to have users download the bundle on the background so that when they open the app, they are directly interacting with the newer version rather than having to load an older JS bundle, checking with CodePush and downloading and THEN prompting user to reload app for optimal experience.
wondering if codePush.sync
can work with firebase.messaging().setBackgroundMessageHandler
e.g:
firebase.messaging().setBackgroundMessageHandler((message)=>{
// only sync on FCM with specific data
if(message.data.customDataToLetAppKnowIfShouldSync){
codePush.sync();
}
})
react-native-firebase: https://rnfirebase.io/messaging/usage#background-application-state