Apple Push Notification service_
Send push notifications to apps on Apple devices through Apple Push Notification service (APNs) using Appwrite Messaging.
3 min read
Apple Push Notification service (APNs) lets you send push notifications to Apple devices like macOS, iOS, tvOS, iPadOS, and watchOS devices. APNs is a best-effort service, and will attempt to deliver you messages to your device when it's online and available again. APNs will save the last message for 30 days or less and attempt delivery as soon as it's online.
1. Add provider
To add APNs as a provider, navigate to Messaging > Providers > Create provider > Push notification.

Give your provider a name > choose APNS > click Save and continue. The provider will be saved to your project, but not enabled until you complete its configuration.
2. Configure provider
In the Configure step, you will need to provide details from your Apple developer account to connect your Appwrite project with your Apple developer account.
You will need to provide the following information from the Apple Developer Member Center.
Head to Apple Developer Member Center > Membership details > Team ID

Head to Apple Developer Member Center > Program resources > Certificates, Identifiers & Profiles > Identifiers

Head to Apple Developer Member Center > Program resources > Certificates, Identifiers & Profiles > Keys. Click on your key to view details. The key needs Apple Push Notification Service enabled.

Head to Apple Developer Member Center > Program resources > Certificates, Identifiers & Profiles > Keys. Create a key and give it a name. Enable the Apple Push Notifications service (APNS), and register your key. The key needs Apple Push Notification Service enabled.

Enable sandbox mode for testing on apps signed with development provisioning profiles. APNs offers two environments, Development (sandbox) and Production. Development builds on XCode signed with a development provisioning profile will use the development environment. Production builds signed with a production provisioning profile will use the production environment.
After adding the following details, click Save and continue to enable the provider.
3. Configure app
Some additional configuration is required to enable push notifications in your iOS app. Add push notification capability to your app by clicking your root-level app in XCode > Signing & Capabilities > Capabilities > Search for Push Notifications.

4. Test provider
Push notification requires special handling on the client side. Follow the Send push notification flow to test your provider.
5. Manage provider
You can update or delete a provider in the Appwrite Console.
Navigate to Messaging > Providers > click your provider. In the settings, you can update a provider's configuration or delete the provider.
To update or delete providers programmatically, use an Appwrite Server SDK.
const sdk = require('node-appwrite');
// Init SDKconst client = new sdk.Client();
const messaging = new sdk.Messaging(client);
client .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<PROJECT_ID>') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key;
const provider = await messaging.updateApnsProvider({ providerId: '<PROVIDER_ID>', name: '<NAME>', enabled: false, authKey: '<AUTH_KEY>', authKeyId: '<AUTH_KEY_ID>', teamId: '<TEAM_ID>', bundleId: '<BUNDLE_ID>'});Was this page helpful?
Share what worked or what we should fix. Once approved, our agents automatically apply suggested updates to the docs.