Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):
What you expected to happen?
I expect the app to restart and apply a new code push package based on the different deployment key.
What actually happens?
Nothing happens on the ui.
STACK TRACE AND/OR SCREENSHOTS
logs:
An update is available, but it is being ignored due to having been previously rolled back
(The more info the faster we will be able to address it!)
Hi @Catpants
Please see example usage of SyncOptions.
Shortly, in your case:
codePush.sync({
deploymentKey: "KEY",
installMode: codePush.InstallMode.IMMEDIATE
});
Thanks!
@iTOYS I apologise, my original code example was not accurate. I am indeed calling it like this:
codePush.sync(
{ installMode: codePush.InstallMode.IMMEDIATE, deploymentKey: Config.CODEPUSH_KEY_IOS }
)
I still have the issue where code push is rolling back and not syncing on demand with two different keys. I would like to know, is it even possible to do this?
I have noticed that calling sync to change deployment from Production to Staging will not install the staging build if CodePush determines that the current (production) bundle is up-to-date. We had to write native code which calls CodePush.clearUpdates() before calling sync so that the requested bundle would be downloaded. I have been meaning to spend more time to debug this situation to see exactly what is happening inside CodePush internals. I cannot confirm exactly what the issue is, but I have seen cases where using sync() to change from Production->Staging (and back) does not always work.
@Catpants
I've checked again with this config:
let codePushOptions = { checkFrequency: codePush.CheckFrequency.MANUAL };
export default App = codePush(codePushOptions)(App);
and with this sync call:
const Staging = "key_staging";
const Production = "key_production";
...
<TouchableOpacity
style = {{height: 70, width: 200, backgroundColor: 'green'}}
onPress={() => {
codePush.sync({
deploymentKey: Production,
updateDialog: true,
installMode: codePush.InstallMode.IMMEDIATE
},
this.codePushStatusDidChange,
this.codePushDownloadDidProgress);
}}>
<Text>Current version: 68(S)</Text>
</TouchableOpacity>
...
So I haven't faced any issue.
Could you please describe your flow?
Thanks!
Hi @Catpants,
I am going to close this issue for now, but please feel free to reopen it if you still have any questions.
i can`t update the app after changing the deploy key remotely plz help
Most helpful comment
I have noticed that calling
syncto change deployment from Production to Staging will not install the staging build if CodePush determines that the current (production) bundle is up-to-date. We had to write native code which callsCodePush.clearUpdates()before callingsyncso that the requested bundle would be downloaded. I have been meaning to spend more time to debug this situation to see exactly what is happening inside CodePush internals. I cannot confirm exactly what the issue is, but I have seen cases where using sync() to change from Production->Staging (and back) does not always work.