getInstallationInfo method

  1. @override
Future<ULinkInstallationInfo?> getInstallationInfo()
override

Gets the current installation info including reinstall detection data.

If this is a reinstall, the returned object will have isReinstall=true and previousInstallationId will contain the ID of the previous installation.

Implementation

@override
Future<ULinkInstallationInfo?> getInstallationInfo() async {
  try {
    final result = await methodChannel.invokeMethod('getInstallationInfo');
    if (result != null && result is Map) {
      final infoMap = Map<String, dynamic>.from(result);
      return ULinkInstallationInfo.fromJson(infoMap);
    }
    return null;
  } catch (e) {
    debugPrint('Error getting installation info: $e');
    return null;
  }
}