sp-react-native-in-app-updates
sp-react-native-in-app-updates copied to clipboard
Android result.shouldUpdate returns - { "line": 3784, "column": 260, "sourceURL": "index.android.bundle" }
Hi guys,
I'm using react-native 0.68.2
in-app-updates version : 1.3.1
I'm keep getting this error from result.shouldUpdate returns - { "line": 3784, "column": 260, "sourceURL": "index.android.bundle" }
My implementation is :
const inAppUpdates = new SpInAppUpdates(
false, // isDebug
);
let updateType;
if (isAndroidFlexibleEnabled) {
updateType = IAUUpdateKind.FLEXIBLE;
} else {
updateType = IAUUpdateKind.IMMEDIATE;
}
// Update functionality start
if (isAndroidForceUpgradeEnabled) {
inAppUpdates.checkNeedsUpdate().then((result) => {
if (result.shouldUpdate) {
const updateOptions = Platform.select({
ios: {
title: 'Update available',
message: 'There is a new version of the app available on the App Store, do you want to update it?',
buttonUpgradeText: 'Update',
buttonCancelText: 'Cancel',
},
android: {
updateType,
},
});
// checking if it's android and ff for android is turned on
if (isAndroid && isAndroidForceUpgradeEnabled) {
inAppUpdates.startUpdate(updateOptions);
}
// checking if it's not android but iOS and ios ff is turned on
if (!isAndroid && isIOSforceUpgradeEnabled) {
inAppUpdates.startUpdate(updateOptions);
}
}
});
}
does anyone faced that before?
Thanks!
I even tried to add the version inAppUpdates.checkNeedsUpdate( { curVersion: '0.0.1' } ).then .. but the same error is showing.
@Aggroid Any solution found?