createDevice abstract method
Future<Result<void> >
createDevice({
- required String id,
- required PushNotificationsProvider pushProvider,
- required String pushProviderName,
Creates a new device for push notifications.
Registers a new device with the Stream Feeds API for receiving push notifications. The device is associated with the current authenticated user and configured with the specified push notification provider.
Example:
final result = await client.createDevice(
id: 'firebase-token-123',
pushProvider: PushNotificationsProvider.firebase,
pushProviderName: 'MyApp Firebase Config',
);
switch (result) {
case Success():
print('Device created successfully');
case Failure(error: final error):
print('Failed to create device: $error');
}
Returns a Result indicating success or failure of the device creation operation.
Implementation
Future<Result<void>> createDevice({
required String id,
required PushNotificationsProvider pushProvider,
required String pushProviderName,
});