'How do you remove/hide the ignore button code-push react-native?

I am new to using code-push for react native app, Everything works okay however I want to hide the Ignore button in the dialog. I dont want the user to ignore any update I have provided, Is this possible?



Solution 1:[1]

From the command line, you can use the mandatory option to hide the ignore button:

# Release a mandatory update with a changelog
code-push release-react MyApp-iOS ios -m --description "Modified the header color"

Solution 2:[2]

If you don't want user ignore the update, then don't show the dialog at all.

Just change codePushOptions so the user always get update when open the app from background in next time:

import React from 'react';
import {
    AppRegistry,
} from 'react-native';

import codePush from "react-native-code-push";

let codePushOptions = {
    checkFrequency: codePush.CheckFrequency.ON_APP_RESUME,
    installMode: codePush.InstallMode.ON_NEXT_RESUME,
};

import App from './app/app';

AppRegistry.registerComponent('yourApp', () => codePush(codePushOptions)(App));

Solution 3:[3]

To begin with it is not recommended to use UpdateDialog within your application because the App could be rejected by AppStore at all due to AppStore Review Guidelines states that

Apps must not force users to rate the app, review the app, download other apps, or other similar actions in order to access functionality, content, or use of the app.

So use it with care and also please see this reference for more details.

As for hiding Ignore button - you could do it providing an empty string instead of button name e.g. as follows:

CodePush.sync( { installMode: CodePush.InstallMode.IMMEDIATE, updateDialog: { optionalIgnoreButtonLabel: "" } }, null, null );

Solution 4:[4]

you can also do the same thing with the help of appcenter webview page . you just only need to: go into the appcenter and indside your AppOverview>>Distribute>>CodePush: .

click on setting icon and click ON on the update required btn.enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nabil Musa
Solution 2 Tyreal Gray
Solution 3 Max Mironov
Solution 4 Deepanshu