Hello,
i’m following the live update capacitor procedure but i get this message:
⚡️ To Native -> LiveUpdates sync 87543445
LiveUpdates - Checking for update for app xxxx
⚡️ TO JS {"message":"Failure occured during check step.\nNetwork request failed with status code 422 when attempting to fetch resources from https:\/\/api.ionicjs.com\/apps\/xxxx\/channels\/check-device","appId":"xxxx","failStep":"CHECK"}
⚡️ [error] - Unhandled Promise rejection: {"message":"Failure occured during check step.\nNetwork request failed with status code 422 when attempting to fetch resources from https://api.ionicjs.com/apps/xxxx/channels/check-device","appId":"xxxx","failStep":"CHECK"} ; Zone: <root> ; Task: Promise.then ; Value: {"message":"Failure occured during check step.\nNetwork request failed with status code 422 when attempting to fetch resources from https://api.ionicjs.com/apps/xxxx/channels/check-device","appId":"xxxx","failStep":"CHECK"} undefined
i’ve added in my app.component.ts this:
async checkLiveUpdate() {
// Register event to fire each time user resumes the app
App.addListener('resume', async () => {
console.log('resume');
this.storage.get('shouldReloadApp').then(async (shouldReloadApp) => {
alert(shouldReloadApp);
if (shouldReloadApp) {
await LiveUpdates.reload();
}
else {
const result = await LiveUpdates.sync();
this.storage.set('shouldReloadApp', result.activeApplicationPathChanged);
}
});
});
// First sync on app load
const result = await LiveUpdates.sync();
this.storage.set('shouldReloadApp', result.activeApplicationPathChanged);
}
any idea on what i’m doing wrong?
ERROR
Error: Uncaught (in promise): Object: {"failStep":"CHECK","appId":"aa8d6f20","message":"Failure occured during check step.\nNetwork request failed with status code 422 when attempting to fetch resources from https://api.ionicjs.com/apps/aa8d6f20/channels/check-device"}
Y — polyfills.6826101f398f79dc.js:1:16057
(anonymous function) — polyfills.6826101f398f79dc.js:1:15139
(anonymous function) — polyfills.6826101f398f79dc.js:1:15249
o — main.8d0b18c6e6a09a86.js:1:525470
ke — main.8d0b18c6e6a09a86.js:1:525692
onInvoke — main.8d0b18c6e6a09a86.js:1:251722
run — polyfills.6826101f398f79dc.js:1:2005
(anonymous function) — polyfills.6826101f398f79dc.js:1:16846
onInvokeTask — main.8d0b18c6e6a09a86.js:1:251542
runTask — polyfills.6826101f398f79dc.js:1:2626
T — polyfills.6826101f398f79dc.js:1:9275