await client.createDevice({
id: "<push token>",
push_provider_name: "production-ios",
});Registering Push Devices
Device Management
Device management allows you to register push tokens with Activity Feeds API, which is used to deliver push notifications to user devices.
Device Registration Limits
Each user has a limit of 25 unique devices. Once this limit is reached, the oldest device will be removed and replaced by the new device.
Device Parameters
| Name | Type | Description | Default | Optional |
|---|---|---|---|---|
id | string | The device ID (push token provided by the push provider) | - | |
user_id | string | The user ID for this device | - | |
push_provider | string | The push provider (APN or Firebase) | - | |
disabled | boolean | Set if the device is disabled | false | ✓ |
disabled_reason | string | Explanation if the device is disabled | - | ✓ |
push_provider_name | string | The push provider name for multi-bundle configurations | - |
Register a Device
Register a device to associate it with a user and enable push notifications for activity updates.
Register the user’s device for push notifications once your user is successfully connected to Activity Feeds.
Multi-bundle configurations require that you specify a push_provider_name when registering a device that corresponds to the name of the push configuration you’ve set up in the dashboard.
Multi-Bundle Device Registration
When using multi-bundle configurations, specify the provider name:
// Configure the push provider info during SDK initialization
let notificationsConfig = PushNotificationsConfig(
pushProviderInfo: PushProviderInfo(
name: "production-ios",
pushProvider: .apn
)
)
let config = FeedsConfig(pushNotificationsConfig: notificationsConfig)
let feedsClient = FeedsClient(
apiKey: apiKey,
user: user,
token: token,
feedsConfig: config,
tokenProvider: tokenProvider
)
// Then register the device
try await feedsClient.createDevice(id: pushToken)$response = $client->createDevice(
new GeneratedModels\CreateDeviceRequest(
id: "<push token>",
pushProviderName: "production-ios",
pushProvider: "apn",
userID: "eric"
)
);List Devices
Get a list of all devices associated with a user.
const devices = await client.listDevices({ user_id: "<user id>" });let devices = try await feedsClient.listDevices()$response = $client->listDevices("<user id>");
$devices = $response->getData()->devices;The device object contains the following properties:
{
created_at: Date,
id: string,
push_provider: string,
user_id: string,
disabled?: boolean,
disabled_reason?: string,
push_provider_name?: string,
voip?: boolean
}public struct Device {
public var createdAt: Date
public var disabled: Bool?
public var disabledReason: String?
public var id: String
public var pushProvider: String
public var pushProviderName: String?
public var userId: String
public var voip: Bool?
}Remove a Device
Remove a device to stop push notifications for that device.
await client.deleteDevice({
id: "<device id>",
});try await feedsClient.deleteDevice(deviceId: savedToken)$response = $client->deleteDevice("<device id>", "<user id>");Troubleshooting
If device registration isn’t working:
- Check your push configuration in the Stream Dashboard
- Verify your device token is valid and current
- Ensure proper permissions are granted for notifications
- Check the push logs in the Stream Dashboard for error messages
- Test with different devices to isolate the issue
For more detailed troubleshooting, check the Activity Feeds logs and error responses from the API.