1 year ago
#191087
Wahidullah Shadab
My app closes instead of reloading after installing in app update
I am using react-native, and I want to add in app update to my app. At first I tried using sp-react-native-in-app-updates. But my app was closing after the update was done. "the expected behavior is to reload with the new version". So I decided to go native and use native modules to implement in-app-update.for the native approach I have followed react-native-in-app-update. But, going native did not help me and My app closes when It's done installing the update. after the app closes if I open it again. it's the updated version. but, the expected behavior for the app is to immediately reloads after installing update.
To make sure I am doing everything in the right way. I have created an app from scratch and followed the same steps and I could get the desired result. The new app was reloading after installing the update.
Dependencies
"dependencies": {
"@ercpereda/react-native-accordion": "^2.0.6",
"@invertase/react-native-apple-authentication": "^1.1.2",
"@react-native-community/art": "^1.2.0",
"@react-native-community/cameraroll": "^4.1.2",
"@react-native-community/image-editor": "^2.3.0",
"@react-native-community/netinfo": "^4.6.1",
"@react-native-community/push-notification-ios": "^1.4.0",
"@react-native-firebase/analytics": "^6.0.4",
"@react-native-firebase/app": "^6.7.1",
"@sentry/react-native": "^1.1.0",
"axios": "^0.18.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"css-loader": "^0.28.11",
"eslint-config-rallycoding": "^3.2.0",
"firebase": "^4.11.0",
"fuse.js": "^3.2.1",
"grpc": "^1.24.2",
"lodash": "^4.17.15",
"moment": "^2.21.0",
"patch-package": "^6.4.7",
"react": "17.0.2",
"react-loading-skeleton": "^0.4.0",
"react-native": "0.67.2",
"react-native-album-list": "^0.1.2",
"react-native-animatable": "^1.2.4",
"react-native-branch": "^4.2.1",
"react-native-calendars": "^1.20.0",
"react-native-camera": "^3.9.0",
"react-native-camera-roll-picker": "^1.3.0",
"react-native-carousel-view": "^0.5.1",
"react-native-checkbox": "^2.0.0",
"react-native-chip-view": "0.0.9",
"react-native-country-picker-modal": "^0.8.0",
"react-native-device-info": "^8.4.9",
"react-native-easy-grid": "^0.1.17",
"react-native-easy-toast": "^1.1.0",
"react-native-fabric": "^0.5.1",
"react-native-fast-image": "^8.3.2",
"react-native-fbsdk": "^3.0.0",
"react-native-flexi-radio-button": "^0.2.2",
"react-native-freshchat-sdk": "^3.3.2",
"react-native-geocoder": "^0.5.0",
"react-native-geolocation-service": "^3.1.0",
"react-native-gesture-handler": "^1.10.3",
"react-native-google-places": "^3.1.2",
"react-native-i18n": "^2.0.12",
"react-native-image-carousel": "^0.4.4",
"react-native-image-pan-zoom": "^2.1.7",
"react-native-image-resizer": "^1.0.0",
"react-native-image-size": "1.1.2",
"react-native-image-view": "^2.0.5",
"react-native-image-zoom-viewer": "^2.2.13",
"react-native-linear-gradient": "^2.5.6",
"react-native-maps": "^0.26.1",
"react-native-material-textfield": "^0.16.1",
"react-native-mixpanel": "^1.1.4",
"react-native-modal-datetime-picker": "^4.13.0",
"react-native-modest-checkbox": "^3.0.1",
"react-native-multiple-select-list": "^1.0.4",
"react-native-onesignal": "^3.5.0",
"react-native-otp": "^1.0.0",
"react-native-permissions": "^3.0.1",
"react-native-phone-call": "^1.0.7",
"react-native-popup-dialog": "^0.14.52",
"react-native-progress": "^4.0.2",
"react-native-push-notification": "^3.1.9",
"react-native-rate": "^1.1.10",
"react-native-reanimated": "^1.13.4",
"react-native-remote-svg": "^1.2.0",
"react-native-responsive-dimensions": "^1.0.2",
"react-native-restart": "0.0.13",
"react-native-router-flux": "^4.2.0",
"react-native-safe-area-context": "^3.1.9",
"react-native-safe-area-view": "^1.1.1",
"react-native-screens": "^2.18.1",
"react-native-select-multiple": "^1.2.0",
"react-native-shadow": "^1.2.2",
"react-native-shimmer-placeholder": "^1.0.35",
"react-native-simple-dialogs": "1.1.0",
"react-native-simple-radio-button": "^2.7.2",
"react-native-smooth-pincode-input": "^1.0.3",
"react-native-snackbar": "^2.0.4",
"react-native-snap-carousel": "3.8.0",
"react-native-splash-screen": "^3.2.0",
"react-native-svg": "^6.3.1",
"react-native-svg-animated-linear-gradient": "^0.1.9",
"react-native-svg-image": "^2.0.1",
"react-native-view-overflow": "0.0.4",
"react-native-webview": "^7.6.0",
"react-redux": "^5.0.7",
"redux": "^3.7.2",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.2.0",
"rn-sliding-up-panel": "^2.4.5",
"sp-react-native-in-app-updates": "^1.1.6"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.66.2",
"react-native-bundle-visualizer": "^2.0.1",
"react-test-renderer": "17.0.2"
},
Testing and Logcat_output:
To download apps using internal app sharing, You need to turn on internal app sharing on your Google Play Store app.
Open the Google Play Store app Google Play.
Tap Menu Menu > Settings.
In the “About” section, tap the Play Store version 7 times.
After the Internal app sharing setting appears, tap the switch to turn on internal app sharing.
Tap Turn on.
then open
https://play.google.com/apps/test/RQBrzWd6q_k/ahAIGJVrejKye6LymizzTdIY85wCTjmWtdA_ZIZ7OtU36IJS7H2TfZAiTckX-cEhcSuEjFdaLyGAKH8Dgfu4T2gvYr
and install the app
now if you open the app. It will not detect an update. For your app to detect the update. you have to open
https://play.google.com/apps/test/RQBrzWd6q_k/ahAIGJVrehWQvkt_2QCjcFlIDTvbtyy43A3XsD1hTAsn3fFCXy3tQgWjc8-oxYTUzJvAJsWXEWyX282iWl3c-heGpA
now go to your app and hopfully your app will detect the update
android
react-native
in-app-update
0 Answers
Your Answer