Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
nnsnodnb committed Jan 2, 2023
1 parent 6e72e2e commit 9bb8e3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ asyncio.run(client.send_message(device_token=registration_id, payload=payload, a
### VoIP

```python
import asyncio
from pathlib import Path

from kalyke import ApnsConfig, ApnsPushType, VoIPClient
Expand All @@ -58,12 +59,12 @@ client = VoIPClient(
auth_key_file_path=Path("/") / "path" / "to" / "YOUR_VOIP_CERTIFICATE.pem",
)

registration_id = "a8a799ba6c21e0795b07b577b562b8537418570c0fb8f7a64dca5a86a5a3b500"

payload = {"key": "value"}
config = ApnsConfig(topic="com.example.App.voip", push_type=ApnsPushType.VOIP)

registration_id = "a8a799ba6c21e0795b07b577b562b8537418570c0fb8f7a64dca5a86a5a3b500"

result = client.send_message(device_token=registration_id, payload=payload, apns_config=config)
asyncio.run(client.send_message(device_token=registration_id, payload=payload, apns_config=config))
```

## License
Expand Down
3 changes: 2 additions & 1 deletion examples/voip.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import asyncio
from pathlib import Path

from kalyke import ApnsConfig, ApnsPushType, VoIPClient
Expand All @@ -14,7 +15,7 @@

registration_id = "a8a799ba6c21e0795b07b577b562b8537418570c0fb8f7a64dca5a86a5a3b500"

result = client.send_message(device_token=registration_id, payload=payload, apns_config=config)
asyncio.run(client.send_message(device_token=registration_id, payload=payload, apns_config=config))

# Send multiple VoIP notifications

Expand Down

0 comments on commit 9bb8e3f

Please sign in to comment.