Sfoglia il codice sorgente

1.添加ios获取uuid的方法

tags/0.0.12
“yanghuaxuan” 3 anni fa
parent
commit
c013c50705
4 ha cambiato i file con 13 aggiunte e 0 eliminazioni
  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 Vedi File

@@ -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 Vedi File

@@ -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 Vedi File

@@ -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 Vedi File

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

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

Caricamento…
Annulla
Salva