Giter VIP home page Giter VIP logo

rn64-test's Introduction

React Native App for Rn64test

System

  • MacOS Big Sur 11.5.2
  • Xcode 13.1
  • Targets: iPhones, iPads, Android Phones, Tablets

Before Getting Started

  • Set up react native on your local machine
    • Note: we need to setup both Expo CLI and React Native CLI below because this was initially an Expo project which was ejected to use bare workflow
    • Visit https://reactnative.dev/docs/environment-setup
    • Choose Expo CLI Quickstart, perform setup according to instructions
    • Choose React Native CLI Quickstart
    • Choose your Development OS, and perform setup for Target OS of Android and IOS (Note: IOS set up requires Xcode, which is only available for MacOS)

Project Setup

  • Only perform the steps below if setup above has been completed
  • Download repo into your local machine
    • git clone https://github.com/rn64test-com/rn64test_buyer_react_native.git
  • Navigate to repo directory and install dependencies
    • cd rn64test_buyer_react_native
    • npm install
  • For MacOS, install CocoaPods dependencies
    • cd ios && npx pod-install && cd ..
  • Run development server
    • npm start
  • Start android simulator
    • npm run android
    • If you encounter errors, check "Common Problems and Troubleshooting" section below to see if it's been encountered before
  • Start ios simulator (only for MacOS)
    • Open rn64test_buyer_react_native/ios/RN64TEST.xcworkspace with XCode
    • Build the app with XCode
    • If you encounter errors, check "Common Problems and Troubleshooting" section below to see if it's been encountered before

Deployment

  • Common steps

    • Update app version in multiple files
      • app.json
      • package.json -Sync release channels
      • AndroidManifest.xml - expo.modules.updates.EXPO_RELEASE_CHANNEL (value = "prod")
      • Expo.plist - EXUpdatesReleaseChannel (value = "prod")
  • Deploy to TestFlight for IOS
    (Note: Only on MacOS. You need an Apple Developer Account invited to RN64TEST LABS PTE. LTD development team)

    • Update app version in xCode (use the same version as common step above)
      • Navigate: General -> Identity -> Version
    • Set target device (at top bar of XCode)
      • Any IOS Device
    • Edit Scheme and Archive
      • Navigate from XCode top menu: Product -> Scheme -> Edit Scheme -> Run (left tab) -> set Build Configuration: Release
      • Navigate from XCode top menu: Product -> Archive
    • Follow on-screen instructions to upload build to TestFlight
    • Related youtube video for step-by-step tutorial
  • Deploy to PlayStore for Android
    (Note: You need a Google Play Console account shared with Rn64test)

    • Update app version in rn64test_buyer_react_native/android/app/build.gradle (use the same version as common step above)
    • Add the following to keychain (ssh-agent, used to sign the app during build. Ask Edward for rn64test_android_keystore value)
      • keychain item name: rn64test_android_keystore
      • account name: rn64test_account_name
      • rn64test_android_keystore: (Ask Edward for value)
    • Build .aab (Android App Bundle) file
      • npm run buildaab
    • Upload build result to PlayStore Developer site
  • Generate .apk file for local installation / sharing
    (Note: for Android only)

    • Navigate to rn64test_buyer_react_native folder,
      • Run cd android && ./gradlew assembleRelease && cd ..
      • Copy .apk file in rn64test_buyer_react_native/android/app/build/outputs/apk/release/app-release.apk to Android devices for installation

Common Problems and Troubleshooting

Over-the-air updates

  • see (expo-update for ejected workflow)

  • npm run publishprod

  • before issuing the publish command, sync the release channels in these files:

    • EXUpdatesReleaseChannel - /RN64TEST/ios/RN64TEST/Supporting/Expo.plist
    • EXPO_RELEASE_CHANNEL - /RN64TEST/android/app/src/main/AndroidManifest.xml
  • also make sure to manually update version/build numbers in every build, and ota updates

    • Android: versionCode and name in /RN64TEST/android/app/build.gradle
    • IOS: Version and Build in xcode -> RN64TEST -> General tab (use xcode to manually edit)
    • Android/IOS: version in app.json and package.json

Navigator/Screens

  • paths: ./navigation, "./screens"
  • Main/Smart components (wrapper) directly called by react navigation navigators
  • Common (slightly reused) components prefixed with "Render" sits here

Reusable Components

  • small and highly reusable components
  • path: "./components"
  • Based on Styled Components

Reusable libraries copied from frontend (web)

  • ./hooks, ./services, ./stores, ./constants ./utils, ./assets, ./styles (themes)
  • uses 2 globalStateObjects for custom global state needs, in passing data and navigation logic

by RN64TEST

rn64-test's People

Contributors

tyrotan avatar

Watchers

 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.