Skip to content

Latest commit

 

History

History
224 lines (159 loc) · 7.97 KB

File metadata and controls

224 lines (159 loc) · 7.97 KB

PPLE Today

PPLE Today Mobile App (Android/iOS)

Feel free to update this file :)

Start Expo Dev Server

  1. Install dependencies

    pnpm install
  2. Setup .env

  3. Start the app

    pnpm dev
  4. We deprecated the expo go dev server since we use expo-native module.

    Press i to open iOS
    Press a to open Android
    

    if problem occured, please see Development Build section down below

Android Development Build

  1. Generate Native android/

    pnpm prebuild:android
  2. Run App

    pnpm android
  3. You can also edit Android native code via Android Studio

    pnpm open:android

iOS Development Build

IMPORTANT you need a mac

  1. Generate Native ios/

    pnpm prebuild:ios
  2. Open ios/ folder with Xcode
    You need to install xcode and iOS development kit

    pnpm open:ios
  3. Install fastlane

    brew install fastlane
  4. Get shared certificates and provisioning profiles

    You need to ask your team for access to development team via App Store Connect

    fastlane match development

    Ask your team for private git repository access
    Input your apple account username and password
    Read more here https://codesigning.guide/

  5. Check your cert and profile in Xcode Project Setting > Signing & Capabilities tab
    Make sure it has Development Profile selected
    Restart Xcode if Certificate is not available

  6. Run App

    pnpm ios

    or you can run on your physical device with

    pnpm ios:device

    check your device and simulators in Xcode > Window > Devices and Simulators

Fastlane - Beta Build

  1. Generate native ios/ and android/

    pnpm prebuild
  2. Install Fastlane

    brew install fastlane
  3. Setup environment variables
    Ask your dev team for .env first
    If you are setting this for yourself, please see Environment Setup down below

  4. Setup Fastlane in native folders

    pnpm fastlane:setup
    

    These are fastlane config file that will be copied to android/ and ios/ folder which will copy files like

    cp -r ./fastlane/android/* ./android

    cp -r ./fastlane/ios/* ./ios

Environment Setup

Development

  • Public environment variables are used in the app, it should be set in .env file
    • EXPO_PUBLIC_OIDC_BASE_URL is your OIDC service base URL
    • EXPO_PUBLIC_OIDC_CLIENT_ID is your OIDC client ID used for mobile apps
    • EXPO_PUBLIC_BACKEND_BASE_URL is your PPLE Today backend base URL
      • For development, it is usually http://localhost:2000
    • EXPO_PUBLIC_ALLOWED_MINI_APP_ORIGIN_REDIRECT is the HTTPS origin for mini-app links (e.g. https://miniapp.peoplesparty.or.th). Required for Universal Links / App Links; see DEEPLINKING.md.
  • The following environment variables are used in local development only, it should not be included in production:
    • OIDC_MANAGEMENT_URL is your OIDC backend URL which might not be the same as EXPO_PUBLIC_OIDC_BASE_URL
    • OIDC_APPLICATION_ID is your OIDC application resource ID used for mobile apps not the same as EXPO_PUBLIC_OIDC_CLIENT_ID
    • OIDC_PROJECT_ID is your OIDC project ID where the application is registered
    • OIDC_ADMIN_TOKEN is your OIDC admin token used for managing OIDC applications in backend

Android

iOS

Notification Service

We setup notification service according to this guide https://docs.expo.dev/push-notifications/sending-notifications-custom/

  • FIREBASE_ANDROID_SERVICE_FILE is base64 encoded of the file google-services.json (please see more details above)
  • FIREBASE_IOS_SERVICE_FILE is base64 encoded of the file GoogleService-Info.plist

VPN Connect

If you connect VPN and dev server can't find your devices, you can set fixed IP by following command to bundle

REACT_NATIVE_PACKAGER_HOSTNAME=<your_private_ip> npx expo start --clear