Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InstallMode -> CodePush.InstallMode, remove 'codePush.sync({ updateDialog: true });' code #1512

Open
KarthiDreamr opened this issue Feb 12, 2024 · 0 comments

Comments

@KarthiDreamr
Copy link

https://learn.microsoft.com/en-us/appcenter/distribution/codepush/tutorials#1--silent-mode

codePush.sync({installMode: InstallMode.IMMEDIATE}); 

InstallMode enum is inside the CodePush, make the following changes to all associated codes

 CodePush.sync({
    installMode: CodePush.InstallMode.IMMEDIATE
     }); 

https://learn.microsoft.com/en-us/appcenter/distribution/codepush/tutorials#2--active-mode

 codePush.sync({ updateDialog: true });

Type 'true' has no properties in common with type 'UpdateDialog'.ts(2559)
(property) SyncOptions.updateDialog?: UpdateDialog | undefined
An "options" object used to determine whether a confirmation dialog should be displayed to the end user when an update is available, and if so, what strings to use. Defaults to null, which has the effect of disabling the dialog completely. Setting this to any truthy value will enable the dialog with the default strings, and passing an object to this parameter allows enabling the dialog as well as overriding one or more of the default strings.

It seems like updateDialog only accepts arguments, not boolean value

var updateDialogOptions = {
        updateTitle: "You have an update",
        optionalUpdateMessage: "Update available. Install?",
        optionalIgnoreButtonLabel: "Nop",
        optionalInstallButtonLabel: "Yep",
    };

    codePush.sync({ updateDialog: updateDialogOptions});

The above code works perfectly

Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

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

No branches or pull requests

2 participants