Giter VIP home page Giter VIP logo

appcentertutorial's Introduction

AppCenter Tutorial - React Native

Instalar a cli do AppCenter como dependência global

npm i -g appcenter-cli

Logar na conta do appcenter

appcenter login

Criar app (React Native)

appcenter apps create -d MeuApp -o Android -p React-Native

Setar app como app em utilização

appcenter apps set-current <ownerName>/<appName>

Criar deployment

appcenter codepush deployment add Production

Verificar os deployments cadastrados

appcenter codepush deployment list

Verificar os deployments cadastrados com suas respectivas chaves

appcenter codepush deployment list -k

Instalar o modulo react-native-code-push

yarn --no-bin-links
yarn add react-native-code-push

The --no-bin-links argument will prevent npm from creating symlinks for any binaries the package might contain.

Atualizar o arquivo android/app/build.gradle, inserindo a linha abaixo, abaixo do apply do react.gradle

apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"

Atualizar o arquivo android/app/src/main/java/com/APPNAME/MainApplication.java incluindo o método abaixo dentro da instância mReactNativeHost

@Override
protected String getJSBundleFile() {
    return CodePush.getJSBundleFile();
}

Atualizar o arquivo android/app/src/main/res/values/strings.xml e incluir as tags abaixo

<string name="appCenterCrashes_whenToSendCrashes" moduleConfig="true" translatable="false">DO_NOT_ASK_JAVASCRIPT</string>
<string name="appCenterAnalytics_whenToEnableAnalytics" moduleConfig="true" translatable="false">ALWAYS_SEND</string>
<string moduleConfig="true" name="CodePushDeploymentKey">CHAVE DO DEPLOY</string>

Na tela principal do app, de preferência a tela de login, dentro do evento componentDidMount() inserir o código abaixo e personalizar de acordo com a necessidade

CodePush.sync({
      installMode: CodePush.InstallMode.ON_NEXT_RESUME,
});

Gerar release no codepush

appcenter codepush release-react -t "*" 

appcentertutorial's People

Contributors

leojanardi avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.