Skip to content

Commit bfbccdd

Browse files
committed
ios getOpid
1 parent 78ce7a9 commit bfbccdd

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 2.5.2
2+
iOS 补充getOpid获取
3+
14
## 2.5.1
25
Android 更新 SDK 到 2.8.4
36

ios/Classes/OpeninstallFlutterPlugin.m

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ typedef NS_ENUM(NSUInteger, OpenInstallSDKPluginMethod) {
1313
OpenInstallSDKMethodReportRegister,
1414
OpenInstallSDKMethodReportEffectPoint,
1515
OpenInstallSDKMethodConfig,
16-
OpenInstallSDKMethodReportShare
16+
OpenInstallSDKMethodReportShare,
17+
OpenInstallSDKMethodGetOpid
1718
};
1819

1920
@interface OpeninstallFlutterPlugin () <OpenInstallDelegate>
@@ -55,7 +56,8 @@ - (void)initData {
5556
@"reportRegister" : @(OpenInstallSDKMethodReportRegister),
5657
@"reportEffectPoint" : @(OpenInstallSDKMethodReportEffectPoint),
5758
@"config" : @(OpenInstallSDKMethodConfig),
58-
@"reportShare" : @(OpenInstallSDKMethodReportShare)
59+
@"reportShare" : @(OpenInstallSDKMethodReportShare),
60+
@"getOpid" : @(OpenInstallSDKMethodGetOpid)
5961
};
6062
}
6163

@@ -130,6 +132,11 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
130132
result(resultDic);
131133
}];
132134
}
135+
case OpenInstallSDKMethodGetOpid:
136+
{
137+
NSString *opid = [[OpenInstallSDK defaultManager] getOpId];
138+
result(opid);
139+
}
133140
default:
134141
{
135142
break;

lib/openinstall_flutter_plugin.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,13 @@ class OpeninstallFlutterPlugin {
126126
}
127127

128128
Future<String?> getOpid() async {
129+
print("getOpid 当初始化未完成时,将返回空,请在业务需要时再获取,并且使用时做空判断");
129130
if (Platform.isAndroid) {
130-
print("getOpid 当初始化未完成时,将返回空,请在业务需要时再获取,并且使用时做空判断");
131131
String? opid = await _channel.invokeMethod('getOpid');
132132
return opid;
133133
} else {
134-
// 仅使用于 Android 平台
135-
return "";
134+
String? opid = await _channel.invokeMethod('getOpid');
135+
return opid;
136136
}
137137
}
138138

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: openinstall_flutter_plugin
22
description: openinstall_flutter_plugin is a Flutter plugin based on openinstall, and with null safety support.
3-
version: 2.5.1
3+
version: 2.5.2
44
homepage: https://www.openinstall.io
55

66
environment:

0 commit comments

Comments
 (0)