getSelfIdsOnOtherPlatform method
获取登录用户在其他登录设备上唯一 ID,该 ID 由 username + "/" + resource 组成。
Return 该方法调用成功会返回 ID 列表。
Throws 如果有方法调用的异常会在这里抛出,可以看到具体错误原因。请参见 ChatError。
Implementation
Future<List<String>> getSelfIdsOnOtherPlatform() async {
try {
Map result = await platform_interface.Client.instance.contactManager
.callNativeMethod(ChatMethodKeys.getSelfIdsOnOtherPlatform);
ChatError.hasErrorFromResult(result);
List<String> devices = [];
result[ChatMethodKeys.getSelfIdsOnOtherPlatform]?.forEach((element) {
devices.add(element);
});
return devices;
} catch (e) {
rethrow;
}
}