Apns
Configuration
The configuration steps are explained in the apns configuration page.
Usage
1. When configured with
{
"app_id": "com.example.myapp",
"badge": "unread",
"certificate": "-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgHnr4B2P+by++FGu/th0a44E8chJl5v5Vo4gq0YHw6e6gCgYIKoZIzj0DAQehRANCAARCg1MRibnfyeX5mx6+Rtfzzn7UhJP/oaqL4RzSmDuTsd3BTX33cuQ0gWHe20R2m1bLAkI1wrp+zbWOlAOAD7KX\n-----END PRIVATE KEY-----",
"key_id": "ABCD1234EF",
"team_id": "ABCD1234EF"
}
2. With a channel token
{
"device_token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt",
"installation_id": "development"
}
3. With Broadcast
{
"action_url": "https://example.com",
"category": "example",
"content": "Hello, World!",
"custom_attributes": {},
"id": "d1b3b3b3-3b3b-3b3b-3b3b-3b3b3b3b3b3b",
"overrides": {},
"recipients": [
{
"custom_attributes": {
"plan": "enterprise",
"preferred_pronoun": "They",
"pricing_version": "v10"
},
"email": "test@example.com",
"external_id": "83d987a-83fd034",
"first_name": "Person",
"last_name": "Doe",
"phone_numbers": [
"+1 5005550001"
]
}
],
"title": "Hello, World!",
"topic": "example"
}
The channel handler triggers a HTTP request
POST https://api.sandbox.push.apple.com/3/device/eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt
With payload
{
"aps": {
"alert": {
"body": "Hello, World!",
"title": "Hello, World!"
}
},
"custom-attributes": {}
}