register_device
The register_device method registers a device token (FCM or APNs) to a specific user, enabling them to receive push notifications.
Usage
await client.register_device(user_id, device_id, platform, token, attributes)
Parameters
| Name | Type | Description |
|---|---|---|
user_id | str | User identifier. |
device_id | str | Unique identifier for the physical device. |
platform | str | Platform type: android, ios, or web. |
token | str | The push registration token. |
attributes | Dict[str, Any] | Optional: Additional device metadata (e.g., OS version, model). |
Example
await client.register_device(
user_id="u_001",
device_id="uuid-1234",
platform="ios",
token="apns-token-hex-string",
attributes={"model": "iPhone 15"}
)