|
@@ -37,10 +37,8 @@ class FlutterAlibc { |
|
|
/// errorMessage, //message |
|
|
/// errorMessage, //message |
|
|
///} |
|
|
///} |
|
|
static Future<InitModel> initAlibc({String version, String appName}) async { |
|
|
static Future<InitModel> initAlibc({String version, String appName}) async { |
|
|
Map result = await _channel |
|
|
|
|
|
.invokeMethod("initAlibc", {"version": version, "appName": appName}); |
|
|
|
|
|
return InitModel( |
|
|
|
|
|
result[AlibcConstKey.errorCode], result[AlibcConstKey.errorMessage]); |
|
|
|
|
|
|
|
|
Map result = await _channel.invokeMethod("initAlibc", {"version": version, "appName": appName}); |
|
|
|
|
|
return InitModel(result[AlibcConstKey.errorCode], result[AlibcConstKey.errorMessage]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// |
|
|
/// |
|
@@ -57,15 +55,9 @@ class FlutterAlibc { |
|
|
result[AlibcConstKey.errorMessage], |
|
|
result[AlibcConstKey.errorMessage], |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
return LoginModel( |
|
|
|
|
|
result[AlibcConstKey.errorCode], result[AlibcConstKey.errorMessage], |
|
|
|
|
|
data: UserModel( |
|
|
|
|
|
result[AlibcConstKey.data]["nick"], |
|
|
|
|
|
result[AlibcConstKey.data]["avatarUrl"], |
|
|
|
|
|
result[AlibcConstKey.data]["openId"], |
|
|
|
|
|
result[AlibcConstKey.data]["openSid"], |
|
|
|
|
|
result[AlibcConstKey.data]["topAccessToken"], |
|
|
|
|
|
result[AlibcConstKey.data]["topAuthCode"])); |
|
|
|
|
|
|
|
|
return LoginModel(result[AlibcConstKey.errorCode], result[AlibcConstKey.errorMessage], |
|
|
|
|
|
data: UserModel(result[AlibcConstKey.data]["nick"], result[AlibcConstKey.data]["avatarUrl"], result[AlibcConstKey.data]["openId"], result[AlibcConstKey.data]["openSid"], |
|
|
|
|
|
result[AlibcConstKey.data]["topAccessToken"], result[AlibcConstKey.data]["topAuthCode"])); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// |
|
|
/// |
|
@@ -86,8 +78,7 @@ class FlutterAlibc { |
|
|
@required String url, |
|
|
@required String url, |
|
|
AlibcOpenType openType = AlibcOpenType.AlibcOpenTypeAuto, |
|
|
AlibcOpenType openType = AlibcOpenType.AlibcOpenTypeAuto, |
|
|
bool isNeedCustomNativeFailMode = false, |
|
|
bool isNeedCustomNativeFailMode = false, |
|
|
AlibcNativeFailMode nativeFailMode = |
|
|
|
|
|
AlibcNativeFailMode.AlibcNativeFailModeNone, |
|
|
|
|
|
|
|
|
AlibcNativeFailMode nativeFailMode = AlibcNativeFailMode.AlibcNativeFailModeNone, |
|
|
AlibcSchemeType schemeType = AlibcSchemeType.AlibcSchemeTaoBao, |
|
|
AlibcSchemeType schemeType = AlibcSchemeType.AlibcSchemeTaoBao, |
|
|
TaokeParams taokeParams, |
|
|
TaokeParams taokeParams, |
|
|
String backUrl, |
|
|
String backUrl, |
|
@@ -111,10 +102,7 @@ class FlutterAlibc { |
|
|
/// name app名字 |
|
|
/// name app名字 |
|
|
/// alibcAppKey 百川Key |
|
|
/// alibcAppKey 百川Key |
|
|
/// Map<String,String> |
|
|
/// Map<String,String> |
|
|
static Future<Map<dynamic, dynamic>> taoKeLoginNew( |
|
|
|
|
|
String name, |
|
|
|
|
|
String alibcAppKey) async { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static Future<Map<dynamic, dynamic>> taoKeLoginNew(String name, String alibcAppKey) async { |
|
|
Map result = await _channel.invokeMethod("taoKeLoginNew", { |
|
|
Map result = await _channel.invokeMethod("taoKeLoginNew", { |
|
|
"name": name, |
|
|
"name": name, |
|
|
"alibcAppKey": alibcAppKey, |
|
|
"alibcAppKey": alibcAppKey, |
|
@@ -135,17 +123,15 @@ class FlutterAlibc { |
|
|
/// backUrl: 跳转回来的url |
|
|
/// backUrl: 跳转回来的url |
|
|
/// @return: |
|
|
/// @return: |
|
|
/// |
|
|
/// |
|
|
static Future<TradeResult> openByUrl({ |
|
|
|
|
|
@required String url, |
|
|
|
|
|
AlibcOpenType openType = AlibcOpenType.AlibcOpenTypeAuto, |
|
|
|
|
|
bool isNeedCustomNativeFailMode = false, |
|
|
|
|
|
AlibcNativeFailMode nativeFailMode = |
|
|
|
|
|
AlibcNativeFailMode.AlibcNativeFailModeNone, |
|
|
|
|
|
AlibcSchemeType schemeType = AlibcSchemeType.AlibcSchemeTmall, |
|
|
|
|
|
TaokeParams taokeParams, |
|
|
|
|
|
String backUrl, |
|
|
|
|
|
bool isAuth = false |
|
|
|
|
|
}) async { |
|
|
|
|
|
|
|
|
static Future<TradeResult> openByUrl( |
|
|
|
|
|
{@required String url, |
|
|
|
|
|
AlibcOpenType openType = AlibcOpenType.AlibcOpenTypeAuto, |
|
|
|
|
|
bool isNeedCustomNativeFailMode = false, |
|
|
|
|
|
AlibcNativeFailMode nativeFailMode = AlibcNativeFailMode.AlibcNativeFailModeNone, |
|
|
|
|
|
AlibcSchemeType schemeType = AlibcSchemeType.AlibcSchemeTmall, |
|
|
|
|
|
TaokeParams taokeParams, |
|
|
|
|
|
String backUrl, |
|
|
|
|
|
bool isAuth = false}) async { |
|
|
Map taoKe = AlibcTools.getTaokeMap(taokeParams); |
|
|
Map taoKe = AlibcTools.getTaokeMap(taokeParams); |
|
|
var result = await _channel.invokeMethod("openByUrl", { |
|
|
var result = await _channel.invokeMethod("openByUrl", { |
|
|
"url": url, |
|
|
"url": url, |
|
@@ -188,8 +174,7 @@ class FlutterAlibc { |
|
|
// bool isNeedPush = false, |
|
|
// bool isNeedPush = false, |
|
|
AlibcOpenType openType = AlibcOpenType.AlibcOpenTypeAuto, |
|
|
AlibcOpenType openType = AlibcOpenType.AlibcOpenTypeAuto, |
|
|
bool isNeedCustomNativeFailMode = false, |
|
|
bool isNeedCustomNativeFailMode = false, |
|
|
AlibcNativeFailMode nativeFailMode = |
|
|
|
|
|
AlibcNativeFailMode.AlibcNativeFailModeNone, |
|
|
|
|
|
|
|
|
AlibcNativeFailMode nativeFailMode = AlibcNativeFailMode.AlibcNativeFailModeNone, |
|
|
AlibcSchemeType schemeType = AlibcSchemeType.AlibcSchemeTmall, |
|
|
AlibcSchemeType schemeType = AlibcSchemeType.AlibcSchemeTmall, |
|
|
TaokeParams taokeParams, |
|
|
TaokeParams taokeParams, |
|
|
// 额外需要追踪的业务数据 |
|
|
// 额外需要追踪的业务数据 |
|
@@ -224,8 +209,7 @@ class FlutterAlibc { |
|
|
// bool isNeedPush = false, |
|
|
// bool isNeedPush = false, |
|
|
AlibcOpenType openType = AlibcOpenType.AlibcOpenTypeAuto, |
|
|
AlibcOpenType openType = AlibcOpenType.AlibcOpenTypeAuto, |
|
|
bool isNeedCustomNativeFailMode = false, |
|
|
bool isNeedCustomNativeFailMode = false, |
|
|
AlibcNativeFailMode nativeFailMode = |
|
|
|
|
|
AlibcNativeFailMode.AlibcNativeFailModeNone, |
|
|
|
|
|
|
|
|
AlibcNativeFailMode nativeFailMode = AlibcNativeFailMode.AlibcNativeFailModeNone, |
|
|
AlibcSchemeType schemeType = AlibcSchemeType.AlibcSchemeTmall, |
|
|
AlibcSchemeType schemeType = AlibcSchemeType.AlibcSchemeTmall, |
|
|
TaokeParams taokeParams, |
|
|
TaokeParams taokeParams, |
|
|
// 额外需要追踪的业务数据 |
|
|
// 额外需要追踪的业务数据 |
|
@@ -259,8 +243,7 @@ class FlutterAlibc { |
|
|
// bool isNeedPush = false, |
|
|
// bool isNeedPush = false, |
|
|
AlibcOpenType openType = AlibcOpenType.AlibcOpenTypeAuto, |
|
|
AlibcOpenType openType = AlibcOpenType.AlibcOpenTypeAuto, |
|
|
bool isNeedCustomNativeFailMode = false, |
|
|
bool isNeedCustomNativeFailMode = false, |
|
|
AlibcNativeFailMode nativeFailMode = |
|
|
|
|
|
AlibcNativeFailMode.AlibcNativeFailModeNone, |
|
|
|
|
|
|
|
|
AlibcNativeFailMode nativeFailMode = AlibcNativeFailMode.AlibcNativeFailModeNone, |
|
|
AlibcSchemeType schemeType = AlibcSchemeType.AlibcSchemeTmall, |
|
|
AlibcSchemeType schemeType = AlibcSchemeType.AlibcSchemeTmall, |
|
|
TaokeParams taokeParams, |
|
|
TaokeParams taokeParams, |
|
|
// 额外需要追踪的业务数据 |
|
|
// 额外需要追踪的业务数据 |
|
@@ -292,4 +275,9 @@ class FlutterAlibc { |
|
|
static useAlipayNative(bool isNeed) { |
|
|
static useAlipayNative(bool isNeed) { |
|
|
_channel.invokeMethod("useAlipayNative", {"isNeed": isNeed}); |
|
|
_channel.invokeMethod("useAlipayNative", {"isNeed": isNeed}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static Future<String> getUdid(bool isNeed) async { |
|
|
|
|
|
var map = await _channel.invokeMethod("getUdid"); |
|
|
|
|
|
return map['udid']; |
|
|
|
|
|
} |
|
|
} |
|
|
} |