From f8f7b1409520da3b204e11c61488d93af1810097 Mon Sep 17 00:00:00 2001 From: Geoffrey Goh Date: Sat, 5 Dec 2015 10:49:35 -0800 Subject: [PATCH] Call notifyApplicationReady during sync --- CodePush.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CodePush.js b/CodePush.js index 1d1fac3..b884f60 100644 --- a/CodePush.js +++ b/CodePush.js @@ -219,8 +219,11 @@ function sync(options = {}, syncStatusChangeCallback, downloadProgressCallback) }; return new Promise((resolve, reject) => { - syncStatusChangeCallback(CodePush.SyncStatus.CHECKING_FOR_UPDATE); - checkForUpdate(syncOptions.deploymentKey) + CodePush.notifyApplicationReady() + .then(() => { + syncStatusChangeCallback(CodePush.SyncStatus.CHECKING_FOR_UPDATE); + return checkForUpdate(syncOptions.deploymentKey); + }) .then((remotePackage) => { var doDownloadAndInstall = () => { syncStatusChangeCallback(CodePush.SyncStatus.DOWNLOADING_PACKAGE); @@ -333,4 +336,4 @@ var CodePush = { } }; -module.exports = CodePush; \ No newline at end of file +module.exports = CodePush;