Giter Club home page Giter Club logo

react-native-code-push-expo-plugin's Introduction

refactor this documentation adding some emojis and adjust some english mistakes:

react-native-code-push-expo-plugin

A plug-in for using react-native-code-push with Expo managed/bare workflow

Setup

  1. Copy the files from this repo and place them into your Expo app directory.
  2. Install the appcenter-cli:
npm install -g appcenter-cli
  1. Install codepush library:
npm install react-native-code-push
  1. Create an app.plugin.js file and add the following code:
module.exports = require("./plugin/build");
  1. Add the following to your Expo app config
  2. Adjust the plugin files as needed for your use case. This will not be a plug-and-play situation in most cases.

Plugin Installation for Expo (Android)

  1. Open your Expo app config file (app.json).

  2. Insert the following into the plugins section of your config (Don't duplicate configuration, if the './app.plugin' item already exists, simply add the android portion.). Create the plugins section if it doesn't already exist.

    "plugins":[
      [
        "./app.plugin",
        {
          "android": {
            "CodePushDeploymentKey": "YOUR_ANDROID_CODE_PUSH_KEY",
          }
        }
      ]
    ]
  3. Replace YOUR_ANDROID_CODE_PUSH_KEY with the Deployment key.

  4. To release a signed release replace your CodePushPublicKey with a public key (https://github.com/microsoft/code-push/tree/v3.0.1/cli#code-signing):

    "plugins":[
      [
        "./app.plugin",
        {
          "android": {
            "CodePushDeploymentKey": "YOUR_ANDROID_CODE_PUSH_KEY",
            "CodePushPublicKey": "-----BEGIN PUBLIC KEY-----\nYOUR_PUBLIC_KEY\n-----END PUBLIC KEY-----"
          }
        }
      ]
    ]
  5. Run npx expo prebuild to regenerate your native code with the codepush dependencies.

  6. To generate an update use the following code:

appcenter codepush release-react -a <ownerName>/MyApp -d Production -k private.pem

Plugin Installation for Expo (IOS)

React Native Code Push comes packaged with a plugin to automate some of the setup process:

  1. Open your Expo app config file (app.config.json or app.config.js instead of app.json).

  2. Insert the following into the plugins section of your config (Don't duplicate configuration, if the './app.plugin' item already exists, simply add the ios portion.). Create the plugins section if it doesn't already exist.

    "plugins": [
      [
        './app.plugin',
        {
          ios: {
            CodePushDeploymentKey: 'YOUR_IOS_CODE_PUSH_KEY',
          },
        }
      ]
    ]
  3. Replace YOUR_IOS_CODE_PUSH_KEY with the Deployment key.

  4. Run npx expo prebuild to regenerate your native code with the codepush dependencies.

  5. To generate an update use the following code:

appcenter codepush release-react -a <ownerName>/MyApp -d Production -k private.pem

react-native-code-push-expo-plugin's People

Contributors

deggertsen avatar mgscreativa avatar pierguinzani avatar

Forkers

marceloanjs

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.