Set up Push for your application
Connect a Bird application, its Push channel and the client that receives the notification. The app's permission and registration flow must work before a campaign or API send can reach it.
Identify the application environment
Keep test and production credentials and registrations associated with their matching application. Record these values before setup:
| Platform | Application identity | Transport and client integration |
|---|---|---|
| iOS | Bundle ID, Apple team, APNs environment and signing entitlements | APNs credentials on the Bird channel; Bird Swift SDK and notification extensions in the app. |
| Android | Android application ID and Firebase project | FCM credentials on the Bird channel; matching google-services.json, Google Services plugin and Bird Android SDK. |
| Web | Website origin and service-worker scope | Bird Web SDK and same-origin service worker; VAPID configuration on the channel. |
Web Push through Bird uses the browser's Push API and VAPID. A direct Firebase Web Messaging integration is a different registration path. For iPhone and iPad web notifications, include an installed Home Screen web app in your test plan and request permission from a user interaction. See WebKit's Web Push requirements.
Configure the Bird channel
Open Developer > Applications in Bird, create the application and enable Push notifications. Configure the gateway credentials for the platforms you use. Copy the application key or web configuration URL from the application's integration instructions, plus the associated Push channel ID. Follow Applications and the Push SDK quickstart.
The application configuration belongs in the installed client. A Channels API access key belongs on your server. The channel ID selects both the send endpoint and the contact identifier key push-{channelId}. Credentials, destination token and channel must describe the same app environment.
Register the device
iOS. Add Bird's Swift package in Xcode. Set the Bird dictionary's ApplicationKey, AppGroup and AccessGroup in the app and notification-extension targets. Configure Push Notifications, Background Modes with Remote notifications, and the shared app/keychain groups. Follow the Swift integration for the notification service and content extensions.
Ask for authorization in the context of a useful feature, then call UIApplication.shared.registerForRemoteNotifications() when authorized. Forward the APNs token in your app delegate to the SDK:
Contoh kode
func application(
_ application: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data
) {
Self.bird.notifications.registerDevice(deviceToken: deviceToken)
}Here Self.bird is the initialized Bird instance from the Swift integration. Forward background notification handling, foreground presentation and notification responses through that guide's delegates. Registration alone does not install those handlers. Check Apple's authorization guidance, including denied and provisional states.
Android. Add com.bird:android-sdk using the version selected for your app, set the com_bird_application_key string, and add the matching Firebase project's google-services.json plus the Google Services plugin. Register the SDK's messaging service inside your application's manifest:
Contoh kode
<service
android:name="com.bird.BirdFirebaseMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>If you already own a Firebase messaging service, extend BirdFirebaseMessagingService and forward its callbacks to super so Bird can process messages and registration changes. Keep one intended handler for MESSAGING_EVENT. Use bird.notifications.requestPermission(activity) from your application's coroutine when the customer chooses to enable notifications. Android 13 and later have a runtime notification permission; also inspect notification-channel and app settings. Follow the Bird Android integration, runnable Android example and Android permission documentation.
Web. Add the Bird SDK script with your application's data-config-url, and serve the Bird Push service-worker loader from your own origin. After bird-sdk-initialized, invoke Bird.pushNotifications.subscribe() from a customer action. It requests permission, creates the subscription and attaches its token to the current Bird contact. Use HTTPS outside localhost and confirm the service worker controls the intended page. The first-notification example includes all files and a server-side send.
Test the complete route
For each platform, test permission allowed and denied, a fresh registration, an updated token, foreground/background delivery, and a tap after the app has started cold. Then test sign-out and a second account on the same device. Follow device registration and deep-link handling.
For a direct send, the Channels API uses the same channel-scoped key and these destination values:
| Client | identifierKey | identifierValue |
|---|---|---|
| Android / FCM | push-{channelId} | firebase:{currentFCMToken} |
| iOS / APNs | push-{channelId} | apns:{currentAPNsToken} |
| Browser / Web Push | push-{channelId} | web:{tokenReturnedBySubscribe} |
Preserve each token exactly, including any internal colons. The message body is type: "list" with list.title and list.text; a single link action supplies a URL destination. Use a Push template for the richer settings described in the Push SDK guide. Save the message ID, inspect its status and verify the actual device separately. Troubleshooting follows that path.
Sumber daya terkait
Lanjutkan dengan dokumentasi, panduan, dan contoh untuk topik ini. Sumber daya tersedia dalam bahasa Inggris.