getDeviceInfo method

  1. @override
Future<Map<String, dynamic>> getDeviceInfo()
override

Get device information from the native platform.

Returns a map containing device-specific information such as:

  • deviceId: Unique device identifier
  • deviceType: Type of device (mobile or tv)
  • token: Authentication token (for TV devices)
  • refreshToken: Refresh token (for TV devices)

Implementation

@override
Future<Map<String, dynamic>> getDeviceInfo() async {
  final result = await methodChannel.invokeMethod<Map<Object?, Object?>>(
    'getDeviceInfo',
  );
  if (result == null) {
    throw PlatformException(
      code: 'DEVICE_INFO_ERROR',
      message: 'Failed to get device info',
    );
  }
  return Map<String, dynamic>.from(result);
}