getMyDevices abstract method
Gets all devices registered for the current user.
Returns a list of all device documents under users/{uid}/devices/,
ordered by lastActiveAt descending (most recent first).
Requirements
- User must be authenticated
- Implemented via backend callable (no direct client Firestore reads)
Use Cases
- Displaying a "My Devices" settings screen
- Admin/debugging tools
- Showing which device will receive notifications
Returns
Right(List<DeviceInfo>)with all user's devicesLeft(RepositoryFailure)on failure or if not authenticated
Example
final result = await deviceService.getMyDevices();
result.fold(
(failure) => showError('Could not load devices'),
(devices) {
for (final device in devices) {
print('${device.platform}: ${device.timezone}');
}
},
);
Implementation
Future<Either<RepositoryFailure, List<DeviceInfo>>> getMyDevices();