Prompt
I’m building a mobile app and want one push API for iOS and Android
Latest observation
Oct 14, 2026
OpenAI APIWeb search: off
A good way to do that is to put a single push notification API in your backend, then have it fan out to the platform-specific services:
- iOS: Apple Push Notification service (APNs)
- Android: Firebase Cloud Messaging (FCM)
Recommended architecture
Your app/backend exposes one endpoint, for example:
POST /notifications/push
Your backend takes a payload like:
{
"userId": "123",
"title": "New message",
"body": "You have a new chat message",
"data": {
"conversationId": "abc"
}
}
Then your push service layer:
- looks up the user’s device tokens
- determines platform (iOS or Android)
- sends to APNs or FCM as appropriate
Why this is the usual approach
There isn’t truly one universal push network for both platforms. The common abstraction is:
- your app/backend uses one API
- your server translates it to APNs/FCM
This keeps your mobile app simple and avoids platform-specific logic in the app.
What you need to store
For each device, store:
userIddeviceTokenplatform(ios/android)appVersionoptionallastSeenoptional
Payload design tips
Keep a common schema, then map to platform-specific fields:
{
"title": "Order shipped",
"body": "Your package is on the way",
"data": {
"orderId": "789"
},
"ios": {
"badge": 1,
"sound": "default"
},
"android": {
"channelId": "orders"
}
}
Implementation options
Option 1: Build it yourself
Use:
- APNs provider API
- FCM HTTP v1 API
Best if you want full control.
Option 2: Use a push abstraction service
Examples:
- OneSignal
- Braze
- Airship
- Firebase for Android plus direct APNs for iOS
Best if you want faster setup and analytics.
Important notes
- Handle token refreshes
- Remove invalid tokens when APNs/FCM returns errors
- Support notification vs data-only pushes
- Respect background execution limits on iOS and Android
If you want, I can give you:
- a sample unified push API spec, or
- a Node.js / Python backend example that sends to both APNs and FCM.