-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to check or start update: [TypeError: Cannot read property 'checkNeedsUpdate' of null] #179
Comments
same error |
this is interesting. Is this a vanilla react-native app? (iOS or Android)? I'm asking because this library is using |
@SudoPlz |
i have the same problem |
i also have the same problem in expo |
@lewismunene020 @malaiandrei |
the app is already on playstore currently so i guess the package name is present at the monent |
is production released ? |
so there is an app in production and am adding the feature into an existing app but i just keep getting the error |
useEffect(() => {
}, []); you can try this package |
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()
}, [])
The text was updated successfully, but these errors were encountered: