ソースを参照

1.添加ios获取uuid的方法

tags/0.0.12
“yanghuaxuan” 3年前
コミット
c013c50705
4個のファイルの変更13行の追加0行の削除
  1. +2
    -0
      ios/Classes/FlutterAlibcPlugin.m
  2. +1
    -0
      ios/Classes/Handle/FlutterAlibcHandle.h
  3. +9
    -0
      ios/Classes/Handle/FlutterAlibcHandle.m
  4. +1
    -0
      lib/flutter_alibc.dart

+ 2
- 0
ios/Classes/FlutterAlibcPlugin.m ファイルの表示

@@ -52,6 +52,8 @@
[_handler syncForTaoke:call result:result];
}else if([@"useAlipayNative" isEqualToString:call.method]){
[_handler useAlipayNative:call result:result];
}else if([@"getUdid" isEqualToString:call.method]){
[_handler getUdid:call result:result];
}else {
result(FlutterMethodNotImplemented);
}


+ 1
- 0
ios/Classes/Handle/FlutterAlibcHandle.h ファイルの表示

@@ -94,6 +94,7 @@ NS_ASSUME_NONNULL_BEGIN
@param result <#result description#>
*/
- (void)useAlipayNative:(FlutterMethodCall *)call result:(FlutterResult)result;
- (void)getUdid:(FlutterMethodCall *)call result:(FlutterResult)result;
@end

NS_ASSUME_NONNULL_END

+ 9
- 0
ios/Classes/Handle/FlutterAlibcHandle.m ファイルの表示

@@ -14,6 +14,7 @@
#import "FlutterWxViewCtrlViewController.h"
#import <AlibabaAuthEntrance/ALBBSDK.h>
#import <AlibabaAuthEntrance/ALBBCompatibleSession.h>
#import "UTDID/UTDevice.h"
@implementation FlutterAlibcHandle
FlutterMethodChannel *_flutterAlibcChannel = nil;

@@ -293,6 +294,14 @@ FlutterMethodChannel *_flutterAlibcChannel = nil;
BOOL isNeed = [call.arguments[@"isNeed"] boolValue];
[[AlibcTradeSDK sharedInstance] setShouldUseAlizfNative:isNeed];
}

//获取udid
- (void)getUdid:(FlutterMethodCall *)call result:(FlutterResult)result{
NSUUID *identifierForVendor = [[UIDevice currentDevice] identifierForVendor];
NSDictionary* map=@{@"udid" : [UTDevice utdid]};
result(map);
}

#pragma mark - 不对flutter暴露
#pragma mark --打开page
- (void)OpenPageByNewWay:(id<AlibcTradePage>)page BizCode:(NSString *)bizCode Call:(FlutterMethodCall *)call callback:(FlutterResult)callback{


+ 1
- 0
lib/flutter_alibc.dart ファイルの表示

@@ -278,6 +278,7 @@ class FlutterAlibc {

static Future<String> getUdid() async {
var map = await _channel.invokeMethod("getUdid");
print(map);
return map['udid'];
}
}

読み込み中…
キャンセル
保存