fix(core): 非移动端跳过设备区域读取,避免注册流程卡住
This commit is contained in:
1 parent
bfe0df62dc
commit
9983d42015
1 file changed
+3
@@ -38,6 +38,9 @@ class DeviceIdProvider {
|
||||
/// Android 依次取网络运营商 / SIM 卡 / 系统语言的国家,iOS 取系统 region。
|
||||
Future<String?> deviceRegion() async {
|
||||
if (kIsWeb) return null;
|
||||
// 只有两端原生侧实现了 region;其它平台(测试、桌面)上通道没有 handler,
|
||||
// 调用会一直挂着,注册流程会卡在"转圈"。
|
||||
if (!Platform.isAndroid && !Platform.isIOS) return null;
|
||||
try {
|
||||
final region = await _channel.invokeMethod<String>('region');
|
||||
final value = region?.trim().toUpperCase() ?? '';
|
||||
|
||||
Reference in new issue
Block a user