“yanghuaxuan” c013c50705 | 3 anos atrás | |
---|---|---|
android | 3 anos atrás | |
example | 3 anos atrás | |
ios | 3 anos atrás | |
lib | 3 anos atrás | |
test | 4 anos atrás | |
.gitignore | 4 anos atrás | |
.metadata | 4 anos atrás | |
CHANGELOG.md | 4 anos atrás | |
LICENSE | 4 anos atrás | |
README.md | 4 anos atrás | |
pubspec.lock | 3 anos atrás | |
pubspec.yaml | 4 anos atrás |
Flutter版本的阿里百川 android V4.0.0.8版本 ios V4.0.1.6 版本
pub地址:flutter_alibc github地址:flutter_alibc
可以给个star🐴,混口饭吃
支持Android和iOS
邮箱:
Android:983598009@qq.com
iOS:329106954@qq.com P.S:另有开普勒插件flutter_kepler
参考阿里百川官网
如何引入项目 iOS请在podfile文件非注释的第一行,加入淘宝源,如果有其他源,请放在其他源下方,没有其他源只需要加这一个即可
source 'http://repo.baichuan-ios.taobao.com/baichuanSDK/AliBCSpecs.git'
看不懂这句话就看下demo中的example/ios/podfile文件第4行代码,第3行是其他源的示例可以不加
import 'package:flutter_alibc/flutter_alibc.dart';
/**
* 初始化
* version:当前app版本
* appName:当前app名称
* result:{
* errorCode, //0为初始化成功,其他为失败
* errorMessage, //message
* }
*/
var result = await FlutterAlibc.initAlibc(version:"",appName:"");
/**
* 登录淘宝
* version:当前app版本
* appName:当前app名称
* result:{
* errorCode, //0为初始化成功,其他为失败
* errorMessage, //message
* data:{ //登录成功的情况下返回data,为用户数据
* //nick 用户昵称,avatarUrl 头像地址
* nick,avatarUrl,openId,openSid,topAccessToken,topAuthCode
* }
* }
* 备注:登录过会直接返回淘宝用户的信息,不会多次唤醒淘宝,请放心
*/
var result = await FlutterAlibc.loginTaoBao();
FlutterAlibc.loginOut();
/**
* @description: 获取access_token
* @param
* url:用于授权登录的url
* openType:打开类型,默认auto
* isNeedCustomNativeFailMode:是否需要设置唤端失败策略,默认false
* nativeFailMode:唤端失败策略,默认None
* schemeType:唤起哪个端,默认天猫
* taokeParams:淘客数据
* backUrl: 跳转回来的url
* @return: {accessToken:""}//获取成功为token,获取失败为空字符串
*/
var result = await FlutterAlibc.taoKeLogin(
url:"", //必须参数,用于授权登录的url
openType : AlibcOpenType.AlibcOpenTypeAuto,
isNeedCustomNativeFailMode : false,
nativeFailMode : AlibcNativeFailMode.AlibcNativeFailModeNone,
schemeType : AlibcSchemeType.AlibcSchemeTmall,
taokeParams : {},
backUrl:"",
);
/**
* @description: 通过url打开,包括h5,唤起手淘等
* @param
* url:目标url
* openType:打开类型,默认auto
* isNeedCustomNativeFailMode:是否需要设置唤端失败策略,默认false
* nativeFailMode:唤端失败策略,默认None
* schemeType:唤起哪个端,默认天猫
* taokeParams:淘客数据
* backUrl: 跳转回来的url
* @return: {
* errorCode,
* errorMessage,
* type, //0为添加购物车,1为付款成功
* payResult, //type为1时返回
* }
*/
var result = await FlutterAlibc.openByUrl(
url:"", //必须参数
openType : AlibcOpenType.AlibcOpenTypeAuto,
isNeedCustomNativeFailMode : false,
nativeFailMode : AlibcNativeFailMode.AlibcNativeFailModeNone,
schemeType : AlibcSchemeType.AlibcSchemeTmall,
taokeParams : {},
backUrl:"",
);
/**
* @description: 打开商品详情
* @param
* itemID 商品id,可以是真实的也可以是混淆的,必须参数
* trackParam 需要额外追踪的业务数据
* 其他同上
* @return: 同openByUrl
*/
var result = await FlutterAlibc.openItemDetail(
itemID:"", //必须参数
openType : AlibcOpenType.AlibcOpenTypeAuto,
isNeedCustomNativeFailMode : false,
nativeFailMode : AlibcNativeFailMode.AlibcNativeFailModeNone,
schemeType : AlibcSchemeType.AlibcSchemeTmall,
taokeParams : {},
trackParam : {}, //需要额外追踪的业务数据
backUrl:"",
);
/**
* @description: 打开店铺
* @param
* shopId 店铺id,必须参数
* 其他同上
* @return: 同openByUrl
*/
var result = await FlutterAlibc.openShop(
shopId:"", //必须参数
openType : AlibcOpenType.AlibcOpenTypeAuto,
isNeedCustomNativeFailMode : false,
nativeFailMode : AlibcNativeFailMode.AlibcNativeFailModeNone,
schemeType : AlibcSchemeType.AlibcSchemeTmall,
taokeParams : {},
trackParam : {}, //需要额外追踪的业务数据
backUrl:"",
);
/**
* @description: 打开购物车
* @param
* 无必须参数
* 其他同上
* @return: 同openByUrl
*/
var result = await FlutterAlibc.openCart(
openType : AlibcOpenType.AlibcOpenTypeAuto,
isNeedCustomNativeFailMode : false,
nativeFailMode : AlibcNativeFailMode.AlibcNativeFailModeNone,
schemeType : AlibcSchemeType.AlibcSchemeTmall,
taokeParams : {},
trackParam : {}, //需要额外追踪的业务数据
backUrl:"",
);
FlutterAlibc.syncForTaoke(true);
FlutterAlibc.useAlipayNative(true);