You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for great package.
I am implementing this package with IAUUpdateKind.FLEXIBLE and its working fine. But I want to just download the update.
And install the update on start of App later next time.
Sometime its working sometime it doesn't
I tried:- readStorage and writeStorage are AsyncStorage function to read and write.
const inAppUpdates = new SpInAppUpdates(false);
useEffect(() => {
handleAppUpdate();
}, []);
const handleAppUpdate = async () => {
readStorage('isAppUpdateAvailable').then((updateAvailable) => {
if (updateAvailable) {
inAppUpdates.installUpdate();
writeStorage('isAppUpdateAvailable', null);
}
});
};
const checkAutoUpdate = () => {
const listener = ({ status }) => {
if (status === IAUInstallStatus.DOWNLOADED) {
writeStorage('isAppUpdateAvailable', 'isAppUpdateAvailable');
//inAppUpdates.installUpdate();
}
};
try {
// curVersion is optional if you don't provide it will automatically take from the app using react-native-device-info
inAppUpdates.checkNeedsUpdate().then((result) => {
if (result.shouldUpdate) {
console.log('result.shouldUpdate', result.shouldUpdate);
let updateOptions: StartUpdateOptions = {};
if (Platform.OS === 'android') {
// android only, on iOS the user will be promped to go to your app store page
inAppUpdates.addStatusUpdateListener(listener);
updateOptions = {
updateType: IAUUpdateKind.FLEXIBLE,
};
} else {
updateOptions = {
title: 'Update available',
message:
'There is a new version of Cutshort available on the App Store, do you want to update it?',
buttonUpgradeText: 'Update',
buttonCancelText: 'Cancel',
};
}
inAppUpdates.startUpdate(updateOptions);
}
});
} catch (error) {
console.log('___ERROR', error);
}
};
The text was updated successfully, but these errors were encountered:
Thanks for great package.
I am implementing this package with
IAUUpdateKind.FLEXIBLE
and its working fine. But I want to just download the update.And install the update on start of App later next time.
Sometime its working sometime it doesn't
I tried:-
readStorage
andwriteStorage
areAsyncStorage
function to read and write.The text was updated successfully, but these errors were encountered: