How to use the react-native-code-push.sync function in react-native-code-push

To help you get started, we’ve selected a few react-native-code-push examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github birkir / hekla / src / screens / settings / About.tsx View on Github external
onBetaChange(flag: boolean) {
    // TODO: Prompt user to confirm and that the app will likely restart.
    UI.settings.setValue('isBeta', flag);
    const config = codePushConfig();
    config.installMode = CodePush.InstallMode.IMMEDIATE;
    CodePush.sync(config);
  }
github Thinkmill / react-conf-app / app / ReactConf2017.js View on Github external
syncAppVersion = () => {
    codePush.sync({ mandatoryInstallMode: codePush.InstallMode.IMMEDIATE });
  };
github liuhongjun719 / react-native-DaidaiHelperNew / app / containers / HomeContainer.js View on Github external
componentDidMount() {
    CodePush.sync({
      deploymentKey: 'lCYb0hSXQUEJHWiSykloC7wXu_19V1dAekTcW',
      updateDialog: {
        optionalIgnoreButtonLabel: '稍后',
        optionalInstallButtonLabel: '后台更新',
        optionalUpdateMessage: '“贷贷助手”有新版本了,是否更新?',
        title: '更新提示',
      },
      installMode: CodePush.InstallMode.ON_NEXT_RESTART,
    });
  }
github wkl007 / GitHubPopular / src / page / my / MyPage.js View on Github external
update () {
    codePush.sync({
      updateDialog: {
        title: '更新',
        appendReleaseDescription: true,
        descriptionPrefix: '更新内容:\n',
        mandatoryContinueButtonLabel: '更新',
        mandatoryUpdateMessage: '',
        optionalIgnoreButtonLabel: '忽略',
        optionalInstallButtonLabel: '更新',
        optionalUpdateMessage: '',
      },
      mandatoryInstallMode: codePush.InstallMode.IMMEDIATE,
    })
  }
github ant-design / ant-design-mobile-rn / rn-kitchen-sink / components / Home.js View on Github external
animating: false,
        });
      }
      switch (syncStatus) {
        case 0: Alert.alert(null, '最新版本'); break;
        case 3: Alert.alert(null, '发生错误'); break;
        default: break;
      }
    };
    const onError = function (error) {
      this.setState({
        animating: false,
      });
      Alert.alert(null, `发生错误: ${error}`);
    };
    codePush.sync({
      updateDialog: {
        updateTitle: '检测有更新',
        optionalUpdateMessage: 'demo app 有新版本,是否安装?',
        optionalIgnoreButtonLabel: 'No',
        optionalInstallButtonLabel: 'Yes',
      },
      installMode: codePush.InstallMode.IMMEDIATE,
    }, onSyncStatusChange, null, onError);
  }
github birkir / kvikmyndr-app / src / components / list-item-update-version / ListItemUpdateVersion.js View on Github external
onPress() {
    CodePush.sync({
      ...store.user.codePush,
    }, this.codePushStatusDidChange, this.codePushDownloadDidProgress);
  }
github kenvies / ONE-ReactNative / src / redux / components / MyHomeScreen.js View on Github external
onButtonPress() {
    codePush.sync({
      updateDialog: true,
      installMode: codePush.InstallMode.IMMEDIATE
    });
  }
github okoala / 30DaysofReactNative / checkUpdate.js View on Github external
export default function checkUpdate () {
  const options = {
    updateDialog: {
      appendReleaseDescription: true,
      title: '有更新',
      descriptionPrefix: '更新内容:',
      mandatoryContinueButtonLabel: '继续',
      mandatoryUpdateMessage: '必须更新才能继续使用',
      optionalIgnoreButtonLabel: '忽略',
      optionalInstallButtonLabel: '安装',
      optionalUpdateMessage: '有新的版本,你想要安装吗?'
    },
    installMode: CodePush.InstallMode.IMMEDIATE
  }

  CodePush.sync(options, status => {
    switch (status) {
      case CodePush.SyncStatus.DOWNLOADING_PACKAGE:
        this.refs.nav.push({
          component: Loading,
          title: ' ',
          navigationBarHidden: true,
          leftButtonTitle: '',
          onLeftButtonPress: () => {}
        })
        break
      case CodePush.SyncStatus.INSTALLING_UPDATE:
        break
      case CodePush.SyncStatus.AWAITING_USER_ACTION:
        break
    }
  })