await codePush.sync({
installMode: codePush.InstallMode.ON_NEXT_SUSPEND
mandatoryInstallMode: codePush.InstallMode.ON_NEXT_SUSPEND
})
When putting the app in background, the update should be properly installed. When resuming the app to active status, it should work, even if showing a white screen for a short time.
When putting the app in background, I can correctly see the update as installed on appcenter dashboard.
When resuming the app to active status, a white screen is showed and the app get freezed in this status.
Hi, @TommyBez ,
Thanks for reporting!
Unfortunately, I can't reproduce this issue. Could you please provide logs during update and also it will be helpful if you provide some demo app with reproducing issue and reprosteps.
Please let me know if you have any questions.
Hi @alexandergoncharov,
Thank you for your prompt response!
Unfortunately, I'm not currently able to provide a demo app.
I will add logs for sure as soon as possible.
In the meantime, I would add more details regarding my implementation.
I'm using react-native-navigation (6.3.1) and for this reason I'm not wrapping my root component with Code Push HOC.
I'm initializing code push in my start-up function, calling this initialize method:
const initialize = async () => {
await sync()
AppState.addEventListener('change', async newState => {
if (newState === 'active') {
sync()
}
})
}
const sync = async (options = {}) => {
const update = await codePush.checkForUpdate()
const minimumBackgroundDuration = update?.isMandatory
? 0
: MINIMUM_BACKGROUND_SECONDS
await codePush.sync({
installMode: codePush.InstallMode.ON_NEXT_SUSPEND,
mandatoryInstallMode: codePush.InstallMode.ON_NEXT_SUSPEND,
minimumBackgroundDuration,
...options,
})
}
This is working properly on iOS but not on Android.
I had the same problem with react-native 0.63.3 and react-native-code-push 6.4.0 IOS is getting the code push , and Android doesn't.
@TommyBez @alexandergoncharov any update ?
@galdanay Unfortunately I haven't found a solution yet. Still searching the time to investigate deeper.
I am also experiencing the same problem on Android, with react-native 0.63.4, using react-native-code-push v6.4.0. I am also using react-native-navigation v7.8.1 by Wix, which seems to have some known issues from the earlier versions.
In my case, I am seeing that the update does get installed, and gets applied successfully after the app resumes. However, as described in the issue above, my app also gets stuck on a white screen. The only way to resolve this is to kill the app and restart.
@helenkuang Did you manage to figure it out?
My use case is the same as yours so I'm struggling with the same issues.
@riordanpawley Unfortunately not. Right now, we're just using installMode: codePush.InstallMode.ON_NEXT_RESTART, which is not our preferred way for CodePush to work for our app, but it gets the job done.