Apple Push Notification Service binding spec

Detailed documentation on the Apple Push Notification Service binding component

Configuration

  1. apiVersion: dapr.io/v1alpha1
  2. kind: Component
  3. metadata:
  4. name: <NAME>
  5. namespace: <NAMESPACE>
  6. spec:
  7. type: bindings.apns
  8. version: v1
  9. metadata:
  10. - name: development
  11. value: <true | false>
  12. - name: key-id
  13. value: <APPLE_KEY_ID>
  14. - name: team-id
  15. value: <APPLE_TEAM_ID>
  16. - name: private-key
  17. secretKeyRef:
  18. name: <SECRET>
  19. key: <SECRET-KEY-NAME>
  • database tells the binding which APNs service to use. Set to true to use the development service or false to use the production service. If not specified, the binding will default to production.
  • key-id is the identifier for the private key from the Apple Developer Portal.
  • team-id is the identifier for the organization or author from the Apple Developer Portal.
  • private-key is a PKCS #8-formatted private key. It is intended that the private key is stored in the secret store and not exposed directly in the configuration.

Request Format

  1. {
  2. "data": {
  3. "aps": {
  4. "alert": {
  5. "title": "New Updates!",
  6. "body": "There are new updates for your review"
  7. }
  8. }
  9. },
  10. "metadata": {
  11. "device-token": "PUT-DEVICE-TOKEN-HERE",
  12. "apns-push-type": "alert",
  13. "apns-priority": "10",
  14. "apns-topic": "com.example.helloworld"
  15. },
  16. "operation": "create"
  17. }

The data object contains a complete push notification specification as described in the Apple documentation. The data object will be sent directly to the APNs service.

Besides the device-token value, the HTTP headers specified in the Apple documentation can be sent as metadata fields and will be included in the HTTP request to the APNs service.

Response Format

  1. {
  2. "messageID": "UNIQUE-ID-FOR-NOTIFICATION"
  3. }

Output Binding Supported Operations

  • create

Last modified February 16, 2021: Merge pull request #1235 from dapr/update-v0.11 (b4e9fbb)