How to use the react-native-code-push 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 duheng / Mozi / src / root.js View on Github external
/**
 * Author: 墨子
 * GitHub: https://github.com/duheng/Mozi
 * Email: duheng1100@163.com
 */
import React, { Component, } from 'react';
import { Provider, } from 'react-redux';
import SplashScreen from 'react-native-splash-screen';
import codePush from 'react-native-code-push';
import configureStore from './app/store/configureStore';
import App from './AppNavigationState';

const store = configureStore();

@codePush({
  checkFrequency: codePush.CheckFrequency.ON_APP_RESUME,
  installMode: codePush.InstallMode.ON_NEXT_SUSPEND,
})
export default class Root extends Component {
  componentDidMount() {
    SplashScreen.hide(); // 隐藏启动屏
  }

  render() {
    console.log('store----', store);
    return (
      
        
      
    );
  }
github pankod / react-native-boilerplate / src / App / App.tsx View on Github external
public componentDidMount(): void {
		SplashScreen.hide();
	}

	public render(): JSX.Element {
		return (
			
				
					 RouterActions.setNavigationReference(ref)} />
				
			
		);
	}
}

App = codePush(App);
github tranhoangduong1994 / react-native-boilerplate / src / components / common / CodePushComponent.js View on Github external
import codePush from 'react-native-code-push';

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

const CodePushComponent = () => {
  useEffect(() => {
    codePush.sync();
  }, []);

  return null;
};

export default codePush(codePushOptions)(CodePushComponent);
github lisong / code-push-demo-app / App.js View on Github external
},
  welcome: {
    fontSize: 20,
    textAlign: "center",
    margin: 20
  },
});

/**
 * Configured with a MANUAL check frequency for easy testing. For production apps, it is recommended to configure a
 * different check frequency, such as ON_APP_START, for a 'hands-off' approach where CodePush.sync() does not
 * need to be explicitly called. All options of CodePush.sync() are also available in this decorator.
 */
let codePushOptions = { checkFrequency: CodePush.CheckFrequency.MANUAL };

App = CodePush(codePushOptions)(App);

export default App;
github mustafaskyer / rigel-rn / App / App.js View on Github external
render() {
    return (
      
        
          
        
      
    );
  }
}

const codePushOptions = {
  checkFrequency: codePush.CheckFrequency.ON_APP_START, 
}

export default codePush(codePushOptions)(App)
github SystangoTechnologies / Crashalert / RNCrashExamples / js / components / home / index.js View on Github external
function mapStateToProps(state) {
  return {
    user: state.user.response,
    profileImage: state.user.profileImage,
    isFetching: state.user.isFetching,
  };
}

function bindActions(dispatch) {
  return {
    actions: bindActionCreators(authActions, dispatch),
    route: bindActionCreators(fetchRoute, dispatch)
  };
}
Home = CodePush(Home);

export default connect(mapStateToProps, bindActions)(Home);
github FormidableLabs / victory-uiexplorer-native / index.js View on Github external
import { AppRegistry } from "react-native";
import codePush from "react-native-code-push";
import VictoryNativeUIExplorer from "./src/victory-native-ui-explorer";

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

const App = codePush(codePushOptions)(VictoryNativeUIExplorer);

AppRegistry.registerComponent("VictoryNativeUIExplorer", () => App);
github insiderdev / minimal-quotes / App.js View on Github external
);
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: 'black',
  },
});

export default codePush(App);
github lomocoin / lomo-rn-boilerplate / src / containers / Splash.tsx View on Github external
alignItems: 'center',
    justifyContent: 'center',
  }
});

interface Props
  extends AuthStoreInjectedProps,
    CommonStoreInjectedProps,
    UserStoreInjectedProps,
    NavigationInjectedProps {}

interface State {
  countdown: number;
}

@codePush(codePushOptions)
@inject('common', 'user', 'auth')
@observer
export default class Splash extends Component {
  showAdsCountdown: boolean;
  loadBackgroudCompleted: boolean;
  state = {
    countdown: 5,
  };

  constructor(props: Props) {
    super(props);

    this.showAdsCountdown = true;
    this.loadBackgroudCompleted = false;
  }
github duheng / Mozi / src / components / CodepushUpdate / index.js View on Github external
right: 0,
    top: 0,
    bottom: 0,
    justifyContent: "center",
    alignItems: "center",
    backgroundColor: "rgba(0,0,0,0.3)",
    height: SHeight,
    width: SWidth,
  },
});

const codePushOptions = {
  checkFrequency: CodePush.CheckFrequency.MANUAL,
  updateDialog: null,
};
export default CodePush(codePushOptions)(HotUpdate);