PPLE Today Mobile App (Android/iOS)
Feel free to update this file :)
-
Install dependencies
pnpm install
-
Setup
.env -
Start the app
pnpm dev
-
We deprecated the expo go dev server since we use expo-native module.
Press i to open iOS Press a to open Androidif problem occured, please see Development Build section down below
-
Generate Native
android/pnpm prebuild:android
-
Run App
pnpm android
-
You can also edit Android native code via Android Studio
pnpm open:android
IMPORTANT you need a mac
-
Generate Native
ios/pnpm prebuild:ios
-
Open
ios/folder with Xcode
You need to install xcode and iOS development kitpnpm open:ios
-
Install fastlane
brew install fastlane
-
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/ -
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 -
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
-
Generate native
ios/andandroid/pnpm prebuild
-
Install Fastlane
brew install fastlane
-
Setup environment variables
Ask your dev team for.envfirst
If you are setting this for yourself, please see Environment Setup down below -
Setup Fastlane in native folders
pnpm fastlane:setupThese are fastlane config file that will be copied to
android/andios/folder which will copy files likecp -r ./fastlane/android/* ./androidcp -r ./fastlane/ios/* ./ios
- Public environment variables are used in the app, it should be set in
.envfileEXPO_PUBLIC_OIDC_BASE_URLis your OIDC service base URLEXPO_PUBLIC_OIDC_CLIENT_IDis your OIDC client ID used for mobile appsEXPO_PUBLIC_BACKEND_BASE_URLis your PPLE Today backend base URL- For development, it is usually
http://localhost:2000
- For development, it is usually
EXPO_PUBLIC_ALLOWED_MINI_APP_ORIGIN_REDIRECTis 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_URLis your OIDC backend URL which might not be the same asEXPO_PUBLIC_OIDC_BASE_URLOIDC_APPLICATION_IDis your OIDC application resource ID used for mobile apps not the same asEXPO_PUBLIC_OIDC_CLIENT_IDOIDC_PROJECT_IDis your OIDC project ID where the application is registeredOIDC_ADMIN_TOKENis your OIDC admin token used for managing OIDC applications in backend
- Please see prerequisite steps https://thecodingmachine.github.io/react-native-boilerplate/docs/BetaBuild/#android
FIREBASE_ANDROID_SERVICE_FILEis a Firebase Project SDK Service Accountgoogle-services.jsoncontent encoded with base64- It can be access by Project Settings > General > Your Apps > Android App > SDK setup and configuration> google-services.json
FIREBASE_ANDROID_SERVICE_CREDENTIALSis base64 encoded with of a key generated to access Google Play Servicekey.jsonis a Google Cloud Service Account Credentials. Please see https://docs.fastlane.tools/getting-started/android/setup/ on topic Collect your Google credentials or https://cdmunoz.medium.com/bye-bye-firebase-token-hello-service-accounts-540ed6cb20c8- To test
key.jsonfile please runfastlane run validate_play_store_json_key json_key:key.json
- We also encode
upload-keystore.jksinto an environment variable calledANDROID_UPLOAD_KEYSTOREwith commandbase64upload-keystore.jksis a key to sign the app before uploading to playstore. Please see https://developer.android.com/studio/publish/app-signingANDROID_UPLOAD_KEYSTORE_PASSWORDis the password of the upload keyANDROID_UPLOAD_KEYSTORE_ALIASis the alias of the upload key
FIREBASE_APP_IDis used in fastlane to distribute beta via Firebase Distribution
-
Please see prerequisite steps https://thecodingmachine.github.io/react-native-boilerplate/docs/BetaBuild/#ios
-
FASTLANE_USERis your Apple Developer Account username -
App Store Connect API Key
- Follow this guide https://docs.fastlane.tools/app-store-connect-api/
- Create/List here https://appstoreconnect.apple.com/access/integrations/api
APP_STORE_CONNECT_API_KEY_IDis the key IDAPP_STORE_CONNECT_API_KEY_ISSUER_IDis the Issuer Id above the tableAPP_STORE_CONNECT_API_KEY_CONTENTis the file content (string with \n)
-
Alternative to the API Key, you can use password + session
FASTLANE_PASSWORDis your Apple Developer Account passwordFASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORDis an App-Specific Password which you can generate here https://appleid.apple.com/account/manageFASTLANE_SESSIONis session token for temporary auth method in our CI right now- Please see https://stackoverflow.com/questions/58097010/fastlane-doesnt-work-for-apple-id-with-two-factor-authentication-on-continuous
- run
fastlane spaceauth -u <your_apple_username> - copy and then single quote it in github variable like this
'---\n ...'
-
MATCH_PASSWORDis your password for accessing Certificates- Create a private git repo for keeping certificates
- Run
fastlane match init - Run
fastlane match developmentfastlane match appstore
-
MATCH_GIT_URLis your repository where you store certificates data usingfastlane match initcommand -
MATCH_GIT_BASIC_AUTHORIZATIONisecho -n <your_github_username>:<your_personal_access_token> | base64- Don't forget to generate
your_personal_access_tokenin GitHub > Settings > Developer settings > Personal access token > Fine-grained tokens https://github.com/settings/personal-access-tokens
- Don't forget to generate
-
PROVISIONING_PROFILE_SPECIFIERismatch AppStore <DEVELOPER_APP_IDENTIFIER>- It should appear here after running match https://developer.apple.com/account/resources/profiles/list
-
APP_STORE_CONNECT_TEAM_ID- Log in to App Store Connect
- https://appstoreconnect.apple.com/WebObjects/iTunesConnect.woa/ra/user/detail
-
DEVELOPER_PORTAL_TEAM_ID
Please go to https://appstoreconnect.apple.com/access/users > Open User Profile Menu (Top Right) > Edit Profile
We setup notification service according to this guide https://docs.expo.dev/push-notifications/sending-notifications-custom/
FIREBASE_ANDROID_SERVICE_FILEis base64 encoded of the filegoogle-services.json(please see more details above)FIREBASE_IOS_SERVICE_FILEis base64 encoded of the fileGoogleService-Info.plist
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