Reputation: 43
I encountered an error while updating my app using CodePush. When calling checkForUpdate with my deploymentKey, I received the following error:
[CodePush] Api calls are disabled, skipping API call
Here’s my code snippet:
const isAvaiable = await codePush.checkForUpdate(deploymentKey);
try {
codePush.allowRestart();
const isAvaiable = await codePush.checkForUpdate(deploymentKey);
if (isAvaiable) {
codePush.setServerUrl(serverUrl);
await codePush.sync(
{
deploymentKey: deploymentKey,
installMode: codePush.InstallMode.IMMEDIATE,
},
status => {
console.log('CodePush status:', status);
},
);
} else {
Alert.alert('Thông báo', 'Hiện tại chưa có bản cập nhật mới nhất.');
}
} catch (err) {
console.log('TCL: onPressOTA -> err', err);
}
my code-push was hosted by myself is following to this docs => https://github.com/microsoft/code-push-server/blob/main/cli/README.md
Could you please help me find a solution to resolve this issue? Any guidance would be greatly appreciated. Thank you!
I have already verified that both the server URL and deployment key are correctly configured, matching the initial setup.
My codePush service is working => curl -I serverUrl
Upvotes: 1
Views: 35