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

NameTypeDescriptionDefaultOptional
idstringThe device ID (push token provided by the push provider)-
user_idstringThe user ID for this device-
push_providerstringThe push provider (APN or Firebase)-
disabledbooleanSet if the device is disabledfalse
disabled_reasonstringExplanation if the device is disabled-
push_provider_namestringThe 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:

$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.

$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
}

Remove a Device

Remove a device to stop push notifications for that device.

$response = $client->deleteDevice("<device id>", "<user id>");

Troubleshooting

If device registration isn’t working:

  1. Check your push configuration in the Stream Dashboard
  2. Verify your device token is valid and current
  3. Ensure proper permissions are granted for notifications
  4. Check the push logs in the Stream Dashboard for error messages
  5. Test with different devices to isolate the issue

For more detailed troubleshooting, check the Activity Feeds logs and error responses from the API.

© Getstream.io, Inc. All Rights Reserved.