Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update setup docs and google-services-example.json #11758

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,6 @@ app/util/termsOfUse/termsOfUseContent.ts
docs/assets/termsOfUse.html

/app/images/branding

# build metadata
android/app/src/main/assets/modules.json
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,12 @@ cd metamask-mobile

Before running the app, keep in mind that MetaMask uses FCM (Firebase Cloud Message) to empower communications. Based on this, as an external contributor you would preferably need to provide your own FREE Firebase project config file with a matching client for package name `io.metamask`, and update your `google-services.json` file in the `android/app` directory as well your `.env` files (`.ios.env`, `.js.env`, `.android.env`), adding `GOOGLE_SERVICES_B64` variable depending on the environment you are running the app (ios/android).

The value you should provide to `GOOGLE_SERVICES_B64` is the base64 encoded version of your Firebase project config file, which can be generated as follows:
ATTENTION: In case you don't provide your own Firebase project config file, you can make use of a mock file at `android/app/google-services-example.json`, following the steps below from the root of the project:

```bash
base64 -i ./android/app/google-services-example.json
echo "export GOOGLE_SERVICES_B64=\"$(base64 -w0 -i ./android/app/google-services-example.json)\"" | tee -a .js.env .ios.env .android.env
```

Copy the result to your clipboard and paste it in the `GOOGLE_SERVICES_B64` variable in the `.env` file you are running the app.

> [!CAUTION]
> In case you don't provide your own Firebase project config file, you will face the error `No matching client found for package name 'io.metamask'`.

You can make usage of a mock file at `android/app/google-services-example.json`, following the same steps above from the root of the project.

In case of any doubt, please follow the instructions in the link below to get your Firebase project config file.
Expand Down
32 changes: 26 additions & 6 deletions android/app/google-services-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
},
"client": [
{
"api_key": [
{
"current_key": ""
}
],
"api_key": [{ "current_key": "" }],
"client_info": {
"mobilesdk_app_id": "1:123456789000:android:f1bf012572b04063",
"client_id": "android:io.metamask",
Expand All @@ -21,7 +17,31 @@
"certificate_hash": []
}
}
},
{
"api_key": [{ "current_key": "" }],
"client_info": {
"mobilesdk_app_id": "1:123456789000:android:f1bf012572b04063",
"client_id": "android:io.metamask.qa",
"client_type": 1,
"android_client_info": {
"package_name": "io.metamask.qa",
"certificate_hash": []
}
}
},
{
"api_key": [{ "current_key": "" }],
"client_info": {
"mobilesdk_app_id": "1:123456789000:android:f1bf012572b04063",
"client_id": "android:io.metamask.flask",
"client_type": 1,
"android_client_info": {
"package_name": "io.metamask.flask",
"certificate_hash": []
}
}
}
],
"configuration_version": "1"
}
}
Loading