Open UtkarshFSD opened 6 months ago
same error TypeError: Cannot read property 'displayName' of undefined, js engine: hermes ERROR TypeError: Cannot read property 'checkNeedsUpdate' of null any one can help ?
this is interesting. Is this a vanilla react-native app? (iOS or Android)? I'm asking because this library is using .ios.ts
or .android.ts
file name extensions which metro bundler knows how to handle.
(I suspect that something on your environment may be different?)
this is interesting. Is this a vanilla react-native app? (iOS or Android)? I'm asking because this library is using
.ios.ts
or.android.ts
file name extensions which metro bundler knows how to handle. (I suspect that something on your environment may be different?)
@SudoPlz I am using react native expo and try to add update feature (no typescript )
i have the same problem react-native@0.72.12 has anyone found a solution?
i also have the same problem in expo @SudoPlz what might the issue
@lewismunene020 @malaiandrei You need to publish your app on the Play Store, and then it will be fixed automatically. If you debug in detail, you might see an error like "package name could not be found" or something similar. However, once the app is published, it works fine.
the app is already on playstore currently so i guess the package name is present at the monent
the app is already on playstore currently so i guess the package name is present at the monent
is production released ? if not you will face this issue
so there is an app in production and am adding the feature into an existing app but i just keep getting the error
useEffect(() => { const init = async () => { try { const currentAppVersion = Constants.expoConfig.version;
const check = await checkVersion({
version: currentAppVersion,
androidStoreURL:
"enter_app_url: "np",
});
if (check.result === "new") {
setIsUpdateAvailable(true);
}
} catch (e) {
showMessage({
message: "Something went wrong",
type: "danger",
});
}
};
init();
}, []);
you can try this package react-native-store-version its working fine in my app https://www.npmjs.com/package/react-native-store-version
Thanks for that it has worked with this code
useEffect(() => {
const init = async () => {
try {
if (Platform.OS === "android") {
const check = await checkVersion({
version: AppConfig.ios_app_version, // app local version
iosStoreURL: AppConfig.iosUrl,
androidStoreURL: AppConfig.playStoreUrl,
country: "jp", // default value is 'jp'
});
if (check.result === "new") {
// if app store version is new
console.log("new version");
Alert.alert(
"New Version Available",
"New version available! Please update the app to the latest version",
[
{
text: "Cancel",
onPress: () => console.log("Cancel Pressed"),
style: "cancel",
},
{
text: "Update",
onPress: () => {
console.log("OK Pressed");
// lets open the playstore app url on android
Linking.openURL(AppConfig.playStoreUrl);
},
},
]
// { cancelable: false }
);
} else {
console.log("latest version");
}
} else {
console.log("not android");
console.log("ios updates coming soon");
}
} catch (e) {
console.log(e);
}
};
init();
}, []);
Thanks for your advice .
Don't know why but I'm getting this error Although , I have installed it correctly & getting the inAppUpdates all props
import SpInAppUpdates, { NeedsUpdateResponse, IAUUpdateKind, StartUpdateOptions, } from "sp-react-native-in-app-updates"
SplashScreen.preventAutoHideAsync()
function IgniteApp() { const inAppUpdates = new SpInAppUpdates(false)
const checkAndUpdateApp = async () => { try { console.log("Before checkNeedsUpdate:", inAppUpdates) const result = await inAppUpdates.checkNeedsUpdate() console.log("Update result:", result)
}
React.useEffect(() => { async function onFetchUpdateAsync() { try { const update = await Updates.checkForUpdateAsync()
}, [])