codepush install metrics not working
Closed this issue · 2 comments
Jeyoung-Park commented
i deployed my own code push server using azure.
but the thing is that install metrics is not working.
code push update is successfully applied in app, but not counted on install metrics.
this is my code
can anybody figure out what is the problem?
const initCodePush = async () => {
if (__DEV__) return;
try {
const update = await CodePush.checkForUpdate();
if (update) {
setCodePushUpdate(true);
CodePush.sync(
{
installMode: CodePush.InstallMode.ON_NEXT_RESTART,
mandatoryInstallMode: CodePush.InstallMode.IMMEDIATE,
},
status => {
switch (status) {
case CodePush.SyncStatus.UPDATE_INSTALLED:
CodePush.notifyAppReady().then(() => {
logEventGA('end_codepush');
setCodePushUpdate(false);
CodePush.restartApp();
});
break;
case CodePush.SyncStatus.UNKNOWN_ERROR:
setCodePushUpdate(false);
console.error('error in code push UNKNOWN_ERROR');
Bugsnag.notify(`error in code push UNKNOWN_ERROR`);
break;
case CodePush.SyncStatus.UP_TO_DATE:
setCodePushUpdate(false);
break;
default:
break;
}
},
({receivedBytes, totalBytes}) => {
const downloadProgress = receivedBytes / totalBytes;
setCodepushProgress(downloadProgress);
},
).catch(error => {
console.error('error in code push', error);
});
}
} catch (error) {
}
};
victor-asdf commented
The install metrics rely on Redis cache server. Make sure your Redis cache server is running and connected.
lucen-ms commented
We have added info about Redis requirement to the Readme.