microsoft / react-native-code-push

React Native module for CodePush
http://appcenter.ms
Other
8.98k stars 1.47k forks source link

【Android】Does the update process necessarily require the current activity to be in the onResume state? #2635

Closed H-Yongzi closed 8 months ago

H-Yongzi commented 10 months ago

My Question

When the Android activity is in the onPause state, restartApp in the CodePushNativeModule class is called and finally enters the loadBundle. Will this cause some exceptions? Or is it necessary that when entering restartApp, the current activity must be in the onResume state?

Steps to Reproduce

  1. open app;
  2. check update & download update
  3. Call the restartApp function in the CodePushNativeModule class
  4. At this time, the system permission request pop-up window will be displayed. and the Activity enters the onPause state.
  5. At this point Android displays a white screen and remains in this state

STACK TRACE AND/OR SCREENSHOTS

image

DmitriyKirakosyan commented 4 months ago

@H-Yongzi, try checking the CodePush logs. If it downloads the update but fails to restart the app, try calling restartApp manually after dismissing the system alerts.