Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

deploymentKey override not working #89

Closed
dylanvdmerwe opened this issue Mar 31, 2016 · 3 comments
Closed

deploymentKey override not working #89

dylanvdmerwe opened this issue Mar 31, 2016 · 3 comments

Comments

@dylanvdmerwe
Copy link

I have left my config.xml file with blank strings for the CodePushDeploymentKey. In code I then determine what the appropriate deploymentKey is and then use the syncOptions method to set the key.

When I run the app, the correct key is set. I get the "Checking for update" status. Then in the logs I see:

ERROR: [CodePush] Could not get the CodePush configuration. Please check your config.xml file.
ERROR: [CodePush] An error occurred during sync.

I thought the whole point of setting the value in the syncOptions was to manually be able to set the key?

 <platform name="android">
        <preference name="CodePushDeploymentKey" value="" />

 <platform name="ios">
        <preference name="CodePushDeploymentKey" value="" />
    getCodePushKey(): string {
        if (this.device.isAndroid) {
            if (AppConstants.IsDebugMode)
                return ''; // staging
            else
                return ''; // production
        }
        else if (this.device.isIos) {
            if (AppConstants.IsDebugMode)
                return ''; // staging
            else
                return ''; // production
        }

        return undefined;
    }


  let syncOptions = {
                    installMode: InstallMode.IMMEDIATE,
                    updateDialog: false,
                    deploymentKey: this.getCodePushKey(),
                };
                window.codePush.sync(this.syncStatusCallback.bind(this), syncOptions, this.syncStaticDownloadProgress.bind(this));
@dylanvdmerwe
Copy link
Author

Seems to be iOS specific.

@geof90
Copy link
Contributor

geof90 commented Mar 31, 2016

@dylanvdmerwe #90 is out for review that fixes this issue, in the meantime while that gets reviewed+merged+published, the workaround is to specify a fake but non-empty value in the config.xml so that it doesn't short circuit the sync process.

@dylanvdmerwe
Copy link
Author

Epic thanks @geof90 - will give it a try!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants