Preview: the PushFleet API isn't live yet. Join the waitlist
Apple (APNs)
PushFleet sends to iPhones, iPads and Macs through the Apple Push Notification service with a token-based .p8 key. One key works for every app on your team, in both the sandbox and production.
Create the key
Section titled “Create the key”- Sign in to the Apple Developer portal and open Certificates, Identifiers & Profiles → Keys.
- Add a key, give it a name and enable Apple Push Notifications service (APNs).
- Download the
.p8file. Apple only lets you download it once, so keep it somewhere safe.
Find the IDs
Section titled “Find the IDs”- Key ID: shown next to the key, and in the file name (
AuthKey_<Key ID>.p8). - Team ID: top right of the developer portal, under your name.
- Bundle ID: your app’s identifier, such as
com.acme.storefront, in Xcode under the target’s Signing & Capabilities.
Turn on the Push Notifications capability for the target in Xcode too, or Apple won’t hand your app a token.
Upload it
Section titled “Upload it”Upload in the dashboard, or with any server SDK. PushFleet verifies the key by minting a real token before it saves it, and never returns it afterwards.
await fleet.credentials.uploadApns({
key: readFileSync("AuthKey_8XK2.p8", "utf8"),
key_id: "8XK2ABCD12",
team_id: "4QX7M2ABCD",
bundle_id: "com.acme.storefront",
});fleet.credentials.upload_apns(
key=open("AuthKey_8XK2.p8").read(),
key_id="8XK2ABCD12",
team_id="4QX7M2ABCD",
bundle_id="com.acme.storefront",
)fleet.Credentials.UploadApns(ctx, pushfleet.CredentialsUploadApnsParams{
Key: pushfleet.ReadFile("AuthKey_8XK2.p8"),
KeyID: "8XK2ABCD12",
TeamID: "4QX7M2ABCD",
BundleID: "com.acme.storefront",
})fleet
.credentials()
.upload_apns()
.key(std::fs::read_to_string("AuthKey_8XK2.p8")?)
.key_id("8XK2ABCD12")
.team_id("4QX7M2ABCD")
.bundle_id("com.acme.storefront")
.await?;fleet.credentials.upload_apns(
key: File.read("AuthKey_8XK2.p8"),
key_id: "8XK2ABCD12",
team_id: "4QX7M2ABCD",
bundle_id: "com.acme.storefront"
)curl https://api.pushfleet.com/v1/credentials/apns \
-H "Authorization: Bearer $PUSHFLEET_SECRET_KEY" \
-H "Content-Type: application/json" \
-d "$(jq -n --rawfile key AuthKey_8XK2.p8 '{key: $key, key_id: "8XK2ABCD12", team_id: "4QX7M2ABCD", bundle_id: "com.acme.storefront"}')"