Skip to main content

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​

NameTypeDescription
user_idstrUser identifier.
device_idstrUnique identifier for the physical device.
platformstrPlatform type: android, ios, or web.
tokenstrThe push registration token.
attributesDict[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"}
)