SudoPlz / sp-react-native-in-app-updates

An in-app updater for the native version of your react-native app.
MIT License
491 stars 66 forks source link

error entering into checkNeedsUpdate function #53

Open Gustavo067 opened 2 years ago

Gustavo067 commented 2 years ago

When I click on the button to update it issues an error

Error: sp-react-native-in-app-updates checkNeedsUpdate error: Error: com.google.android.play.core.install.InstallException: Install Error(-3): The API is not available on this device.

vaishambre31 commented 2 years ago

make sure you use real device for testing...this will not work on any emulator

maroofkarim commented 1 year ago

@Gustavo067 did you find any solution to this issue?

Akhidha00 commented 7 months ago

I also ran into same error.And I checked it in real device by downloading the apk build.But it doesn't work.I am stuck in this issue.Can anyone help me? code.... inAppUpdates = async (deviceData) => {

    const inAppUpdates = new SpInAppUpdates(
        false // isDebug
    );
    inAppUpdates.checkNeedsUpdate({ curVersion: getVersion() }).then(async result => {

        if (result.shouldUpdate) {
            const response = await UserAPI.GetAppVersion(deviceData);

            if(response !== undefined) {
                if(response.error == true){
                    this.toast(response.message);
                }else{               

                        this.setState({isUpdate: response.data.force_update})
                        try{
                            this.openUpdateModel();
                        }catch(e){
                            console.log(e)
                        }
                }
            }else{
                this.toast(Languages.ServerError);
            }

        }
    });
}