Preview: the PushFleet API isn't live yet. Join the waitlist
Android (FCM)
PushFleet sends to Android devices through Firebase Cloud Messaging with a service account from your Firebase project.
Create the service account
Section titled “Create the service account”- Open the Firebase console and pick your project (or create one and add your Android app to it).
- Go to Project settings → Service accounts.
- Click Generate new private key and download the JSON file.
Add your app’s google-services.json to the Android project too, so the client SDK can get a token.
Upload it
Section titled “Upload it”Upload in the dashboard, or with any server SDK. PushFleet verifies the service account by minting a real token before it saves it, and never returns it afterwards.
await fleet.credentials.uploadFcm({
service_account: JSON.parse(readFileSync("service-account.json", "utf8")),
});fleet.credentials.upload_fcm(
service_account=json.load(open("service-account.json")),
)fleet.Credentials.UploadFcm(ctx, pushfleet.CredentialsUploadFcmParams{
ServiceAccount: pushfleet.ReadJSON("service-account.json"),
})fleet
.credentials()
.upload_fcm()
.service_account(serde_json::from_str(&std::fs::read_to_string("service-account.json")?)?)
.await?;fleet.credentials.upload_fcm(
service_account: JSON.parse(File.read("service-account.json"))
)curl https://api.pushfleet.com/v1/credentials/fcm \
-H "Authorization: Bearer $PUSHFLEET_SECRET_KEY" \
-H "Content-Type: application/json" \
-d "$(jq -n --slurpfile service_account service-account.json '{service_account: $service_account[0]}')"