/spree-rnapp

RN app with spree api

Primary LanguageJavaScript

SpreeExampleRNApp

Development

System requirements

  • nodejs 14.2.0
    • yarn: npm install -g yarn
  • ruby 2.7.1
    • bundler: gem install bundler

this repo contains .ruby-version for rbenv, .node-version for nodenv and .tool-versions for asdf-vm

Android

iOS (macOS only)

  • XCode, install via mac Appstore
  • After installing XCode, launch XCode to install components and run sudo xcode-select --switch /Applications/Xcode.app

Get code

git clone git@git.5xruby.com:spree-example/spree-example-rnapp.git
cd spree-example-rnapp

Install dependencies

yarn
bundle

for macOS/iOS

cd ios/
bundle exec pod install
cd ../

you will need to re-run this after changing to node dependencies

Start dev server

yarn start

Signing

iOS

DO NOT CHECK Automatically manage signing! this might break other developers/CI codesign!

We are using fastlane match to manage and prepare iOS certificates and provisioning profiles, see how it works here

Every bundle exec fastlane match command requires passphrase of iOS app certs repo, this will be prompted by the command or set with MATCH_PASSWORD

To get certificates for development
$ bundle exec fastlane match development --readonly

this commands will pull provisioning profiles and certificates from app certificate repo

To update/fix certificates

After

  • updating app capabilities
  • certificate expiring
  • or someone doing something wrong about certificates and provisioning profiles

Provisioning profiles or certificates may become invalid or not sync with app certificate repo, which will make other developers/CI fail

There is an apple dev id (see fastlane/Matchfile) to manage certificates and provisioning profiles, you will need to login to this apple id and its credentials will be requested by fastlane match commands: https://git.5xruby.com/spree-example/spree-example-rnapp/-/wikis/creds#managing-apple-certificates

# for development certificates and provisioning profiles:
$ bundle exec fastlane match nuke development
$ bundle exec fastlane match development

# for appstore and distribution certificates and provisioning profiles:
$ bundle exec fastlane match nuke distribution
$ bundle exec fastlane match appstore

These commands will regenerate provisioning profiles and certificates then sync to app certificate repo

bundle exec fastlane match commands will use login keychain by default, you will be prompted to enter password for this keychain, this password is your mac's user password

Android

This is only required if you want to create a build to upload to play store; For development, this is NOT REQUIRED

To prepare apk signing for releasing to google play, export ANDROID_SIGNING_PASSWORD environments before gradlew / fastlane build:

export ANDROID_SIGNING_PASSWORD=...

Run on Devices

Android

connect to android device with adb debugging or emulator, use adb devices -l to verify, then:

yarn android

iOS

open ios/SpreeExampleRNApp.xcworkspace, choose device/emulator to run and press play button

Release build and deployment (upload)

This is done by Fastlane, please see fastlane/README.md and fastlane/Fastfile