Setup Android Environment
Update Google Sign-In and setup firebase for android
- In firebase/authentification, enable Google Sign-In & apple sign-in.
- Settings -> General -> Android, download
google-services.json
. - In Android Studio, go to the Project view (use the Project tab on the left side).
- Navigate to the 'app' folder inside your project's main directory.
- Paste the
google-services.json
file into the 'app' folder. - in js source src/config/index.js, update the
GOOGLE_SIGNIN_CLIENT_ID
with theclient_id
under this propertyclient/oauth_client/client_id
found in thegoogle-services.json
file, (the id ends with .apps.googleusercontent.com). Make sure to pick the client_id with client_type: 3.
SHA1 key for Firebase (!important)
Google auth requires a SHA1 key to work. You need to add the SHA1 key to the Firebase console.
- To generate a certificate run cd android && ./gradlew signingReport. This generates two variant keys. You have to copy both 'SHA1' and 'SHA-256' keys that belong to the 'debugAndroidTest' variant key option. Then, you can add those keys to the 'SHA certificate fingerprints' on your app in Firebase console.
- Go to the Firebase console.
- Select your project.
- Go to Project settings.
- In the Your apps card, select the Android app.
- In the SHA certificate fingerprints section, click Add fingerprint.
- in prod after releasing the app, you have to add the SHA1 key of the release key to the Firebase console.
- To get the SHA1 key for the release key:
- Run the following command:
keytool -list -v -keystore <PATH_TO_YOUR_RELEASE_KEY> -alias <ALIAS_NAME> -storepass <STORE_PASSWORD> -keypass <KEY_PASSWORD>
- Replace the placeholders with the actual values.
- You will find the SHA1 and SHA-256 keys in the output.
- Run the following command:
- if signing is managed by google play, you can find the SHA1 key in the google play console.
- Go to the Google Play Console.
- Select your app.
- Go to Release > Setup > App Integrity.
- Copy the SHA-1 certificate fingerprint from the App signing certificate section.
- Add the SHA-1 certificate fingerprint to the Firebase project.
Firebase auth service account for backend
- Go to Firebase Console -> Project Settings -> Service Accounts.
- Click on 'Generate new private key'.
- Store if in a secure place, as you won't be able to download it again.
- Save the JSON file in the
.dev
folder in your backend project asfirebase-service-account.json
.
Update Variables in strings.xml
- fb_app_id & fb_client_token:
- Facebook app id: from your app page.
- Client token: Sign into your developer account. On the Apps page, select an app to open its dashboard. In the Dashboard, navigate to Settings > Advanced > Security > Client token.
- code_push_deployment_key: Refer to this guide to get the deployment key: Here
- fb_display_name: Your app's name.
Update Bundle ID for Android
- Update Package in
AndroidManifest.xml
: Modify the package attribute with the new name. - Refactor Package Name: Right-click the package in
app/src/main/java
, select Refactor > Rename, and change the name. - Update
Build.gradle
: ChangeapplicationId
inbuild.gradle
(Module: app) to the new package name. - Revise Code References: Update any old package references in your code, such as in R class imports.
- Clean and Rebuild Project: Use Build > Clean Project, then Build > Rebuild Project.
IAP Product Creation for Android
- Sign in to your Google Play Console.
- Select Your App: Choose the app you want to add the IAP to.
- Create In-App Products: Go to the 'Monetize' section, then 'Products', and select 'In-app products'. Click on 'Create Product'.
- Fill Product Details: Enter the product ID, name, description, and set the pricing.
- Activate Product: Save and activate the in-app product.