Configure FCM credentials so your Rails server can send push notifications to Android devices. If you haven't yet, set up the Rails side first.
Android delivery runs through Firebase Cloud Messaging (FCM). The action_push_native device model stores Android tokens with platform: "google".
Unlike iOS, Android push needs a Firebase project. Its config is compiled into your app, so this is a one-time step.
google-services.json file. Firebase then prompts you to add the SDK and verify the install. Skip those steps. Ruby Native wires up Firebase when it builds your app.google-services.json on the Push tab in the Ruby Native dashboard.That covers the build-time half: the config baked into the app so it can receive notifications.
To send notifications, your server needs a service account key from the same Firebase project.
This JSON is a credential. Treat it like a password and do not commit it to your repo.
On a Google Cloud organization (common with Google Workspace accounts) the download can fail with:
Key creation is not allowed on this service account. Please check if service account key creation is restricted by organization policies.
Your organization enforces a policy that disables service account keys, and you need an organization admin to lift it:
iam.disableServiceAccountKeyCreation), and set it to not enforced for the organization.The contents of that JSON file go into your Rails credentials. Run bin/rails credentials:edit and add the fcm section:
action_push_native:
fcm:
project_id: your-firebase-project-id
encryption_key: |
{
"type": "service_account",
"project_id": "your-firebase-project-id",
"private_key_id": "...",
"private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
"client_email": "...",
...
}
Paste the JSON exactly as Firebase generated it. Keep the inner private_key value untouched, including its \n escapes. Every line must be indented deeper than encryption_key: so YAML reads it as one block.
The installer creates config/push.yml. Add a google section so the gem can send through FCM:
# config/push.yml
shared:
google:
project_id: <%= Rails.application.credentials.dig(:action_push_native, :fcm, :project_id) %>
encryption_key: <%= Rails.application.credentials.dig(:action_push_native, :fcm, :encryption_key)&.dump %>
If your app also supports iOS, this sits alongside the existing apple section. The gem picks the right service per device automatically.