appcenter-docs icon indicating copy to clipboard operation
appcenter-docs copied to clipboard

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

Open KarthiDreamr opened this issue 1 year ago • 0 comments

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.

KarthiDreamr avatar Feb 12 '24 11:02 KarthiDreamr