ti-app / tia-client-v2

0 stars 0 forks source link

Some of the things might not work since the latest migration to latest react native.

TODO: Update this document wherever it is not applicable.

šŸ’» Setup (Currently for Android Only)

1: Clone the repo and cd to root directory.

2: Install the depedencies.

yarn install

3: Install the pods (via Cocoapods) (Required for ios development)

npx pod-install ios

4: Create .env file in root, copy content from https://ti-app.slack.com/archives/CE68JUXPC/p1564943184000300 and paste it in the file.

5: (Optional) Create .prettierrc in root and add your config ;)

6: Ensure that emulator is running or an android device is connected with adb setup properly.

7: Run following command in seperate terminal (not in integrated terminal of vscode).

yarn android

9: Now get your šŸŽ§ on and spill out pure šŸ”„. TIA šŸ™.

Build

Debug Build:

1:

cd android/
./gradlew assembleDebug

You can find the build here: app/build/outputs/apk/


Release Build:

1: Get release.keystore.properties from https://ti-app.slack.com/files/UE5JTSF4Z/FS53VKJN7/release.keystore.properties and put it in ./android directory.

2: Get tiarelase.keystore from https://ti-app.slack.com/files/UE5JTSF4Z/FSGHYL3KP/tiarelease.keystore and put it in ./android/app directory.

3: Generate a release build.

cd android
./gradlew assembleRelease

Resources

Generating sha1 for google-api: https://aboutreact.com/getting-sha1-fingerprint-for-google-api-console/

Troubleshooting

cd android
./gradlew clean
cd ..
yarn android
npm start --reset-cache
# or
yarn start --reset-cache

error Could not install the app on the device, read the error above for details. Make sure you have an Android emulator running or a device connected and have set up your Android development environment:

adb kill-server
adb start-server

Make sure you don't have the previous version of app with differnt signature on your device.

Note: For debug keystore storepass and keypass are generally android.

keytool -list -v -alias {alias-name} -keystore {path-too-keystore}
keytool -exportcert -alias {alias-name} -keystore {path-to-keystore} | openssl sha1 -binary | openssl base64

https://stackoverflow.com/a/52750886/5692089

There is a script named android-release-gradle-fix under ./scripts directory which will do the necessary changes to troubleshoot the above error. For script to run properly, remove the node_modules and run yarn install again.

rm -rf node_modules

yarn install
yarn install --unsafe-perm instead
keytool -list -printcert -jarfile app-release.apk
adb logcat | grep 'com.tiapp'
adb shell setprop log.tag.Fabric DEBUG
adb shell setprop log.tag.CrashlyticsCore DEBUG

To disable:

adb shell setprop log.tag.Fabric INFO
adb shell setprop log.tag.CrashlyticsCore INFO
adb shell setprop debug.firebase.analytics.app package_name

To disable:

adb shell setprop debug.firebase.analytics.app .none.

Samples

(Yet To Add)

TODO:

(Yet To Add)