sp-react-native-in-app-updates: In App Updates not Working
This is my code, I used the implementation listed on Readme file. When I run on closed test Alpha at PlayStore it doesn’t popup any update component. I don’t understand what is wrong.
I implemented also " implementation ‘com.google.android.play:core:1.10.0’ " on android/app/build.gradle.
APP VERSION CODE BEFORE: 25 APP VERSION NAME BEFORE: 1.8
APP VERSION CODE AFTER: 26 APP VERSION NAME AFTER: 1.9
const App = () => {
LogBox.ignoreAllLogs();
const inAppUpdates = new SpInAppUpdates(
false // isDebug
);
// curVersion is optional if you don't provide it will automatically take from the app using rn-device-info
useEffect(() => {
inAppUpdates.checkNeedsUpdate().then((result) => {
if (result.shouldUpdate) {
let updateOptions = {};
if (Platform.OS === 'android') {
// android only, on iOS the user will be promped to go to your app store page
updateOptions = {
updateType: IAUUpdateKind.IMMEDIATE,
};
}
inAppUpdates.startUpdate(updateOptions);
}
});
}, []);
return (
<Provider store={store}>
<PersistGate persistor={persistor}>
<StatusBar
barStyle="light-content"
backgroundColor={DARK_ACCENT_GREEN}
/>
<Routes />
<FlashMessage position="bottom" />
</PersistGate>
</Provider>
);
};
export default App;
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 21 (8 by maintainers)
This import issue is still happening as of version 1.1.7. Importing AndroidInstallStatus makes it so the object is undefined. Importing IAUInstallStatus fixed the issue.
Ok cool, so this falls in place along with the rest of the version name/code changes I have to make. Closing this in favour of an upcoming pr that I will later post here.
ooh interesting 🤔 , I can see how that led to confusion…