flutter微信登录集成
main.dart 初始化(fluwx: ^1.2.1+1)void initWX() async{await fluwx.registerWxApi(appId:"xxxxxxxxxx",doOnAndroid: true,doOnIOS: true,universalLink:"https://www.kx...
·
- main.dart 初始化(fluwx: ^1.2.1+1)
void initWX() async{
await fluwx.registerWxApi(
appId:"xxxxxxxxxx",
doOnAndroid: true,
doOnIOS: true,
universalLink:"https://www.kxxxxxxx/"
);
var result = await fluwx.isWeChatInstalled();
print("is installed $result");
}
2.登录调用
///微信登录
void loginWX() {
print("微信登录");
fluwx
.sendAuth(scope: "snsapi_userinfo", state: "wechat_sdk_demo_test")
.then((data) {
setState(() {
print("拉取微信用户信息:" + data.toString());
});
}).catchError((e) {
print('weChatLogin e $e');
});
}
更多推荐
已为社区贡献5条内容
所有评论(0)