Push Notifications
The Strongly iPhone app shows your notifications as push notifications. The app signs in to any Strongly platform: dev.strongly.ai, or your organization's own install. Every push to the app must be signed with Strongly's APNs key (Apple Push Notification service). Anyone who holds that key can push to every user of the app, so the key never leaves Strongly. It lives in a single service that Strongly runs, the push relay (https://push.strongly.ai), and every platform sends its pushes through it.
How a platform reaches only its own users
- Each platform calls the relay with its own credential, which Strongly issues. The relay keeps only a hash of the credential.
- When a user allows notifications in the app, the app registers its device with the platform the user is signed in to. The platform passes the registration on to the relay, and the relay binds the device to that platform and that user.
- A push names a user, never a device. The relay sends it only to that user's devices bound to the platform that sent it. A platform cannot send to a device it did not register, and it cannot remove another platform's registration.
- If a device signs in to another platform, its registration there replaces the earlier one. The earlier platform no longer reaches that device.
- If Apple says a device can never be reached (the app was removed, or the token belongs to a development build), the relay removes the device. The platform removes it from the user's devices too, and the app registers again the next time it starts.
What each platform sets
| Setting | Value |
|---|---|
PUSH_RELAY_URL | https://push.strongly.ai |
PUSH_RELAY_KEY | the credential Strongly issued this platform |
Set them in the platform's environment (platform-env; for an install, the PUSH_RELAY_URL and PUSH_RELAY_KEY operator inputs in its .env). The dashboard reads environment variables first, then settings.private.pushRelay.url and settings.private.pushRelay.key. Treat the key as a secret.
If either value is missing, the platform sends no push notifications. In-app notifications still work. The dashboard log names the missing values once, and registering a device answers 503 with the same message, which the app shows under its notification settings.
How Strongly issues and revokes a credential
Credentials are made inside the relay. There is no web page or API for them. A Strongly operator runs:
# Issue a credential to a platform. The credential is printed once.
kubectl -n strongly exec deploy/push-relay -- python -m app.instances create --name customer.example.com
# Every platform, with when it was created, whether it is revoked, and how many devices it has.
kubectl -n strongly exec deploy/push-relay -- python -m app.instances list
# Revoke a platform's credential. Its device registrations are removed with it.
kubectl -n strongly exec deploy/push-relay -- python -m app.instances revoke --id <instance id>
Send the printed credential to the platform's operator over a secure channel. It cannot be shown again. To replace a credential, issue a new one, set it on the platform, then revoke the old one. Devices register again the next time the app starts.
What the relay needs
The relay runs on Strongly's own cluster (the platform repo's services.pushRelay, runbook docs/runbooks/push-relay.md). It needs:
- The APNs key: an Apple Push Notifications service key from Strongly's Apple developer account (team
S4UBQ6K2XQ), stored in the Kubernetes Secretpush-relay-apnsasAPNS_KEY_ID(the key's ID) andAPNS_KEY(the contents of the.p8file). Until the Secret exists, the relay runs and answers every push with503, naming the missing values. - Its own database: the MongoDB database
push_relay, reached with a user that can read and write only that database (Secretpush-relay-mongo, keyMONGO_URL). It holds the platforms (instances) and the device registrations (devices). - Its settings:
APNS_TEAM_ID(S4UBQ6K2XQ),APNS_BUNDLE_ID(ai.strongly.mobile) andAPNS_PRODUCTION(true: App Store and TestFlight builds register production tokens).
GET https://push.strongly.ai/health reports whether the relay sends to Apple's production or sandbox service, or which APNs values are missing.
Troubleshooting
| What you see | Why |
|---|---|
| The app says notifications cannot be received: "the push relay is not configured" | The platform has no PUSH_RELAY_URL or PUSH_RELAY_KEY. |
| Dashboard log: "the push relay refused ... 401" | The platform's credential is wrong or was revoked. Ask Strongly for a new one. |
| Dashboard log: "the push relay refused the push: 503 ... APNs is not configured" | The relay has no APNs key yet. |
| Dashboard log: "removed device ...: APNs answered 400 BadDeviceToken" | The device sent a development token (an Xcode Debug build) to the production service. Install the TestFlight or App Store build. |
| Dashboard log: "no longer registered with the push relay for this instance" | The device signed in to another Strongly platform since. |