更新记录
1.0.2(2024-07-01)
1.0.1(2024-06-30)
1.0.0(2024-06-28)
查看更多
平台兼容性
App |
快应用 |
微信小程序 |
支付宝小程序 |
百度小程序 |
字节小程序 |
QQ小程序 |
HBuilderX 4.19,Android:5.0,iOS:12,HarmonyNext:不确定 |
× |
× |
× |
× |
× |
× |
钉钉小程序 |
快手小程序 |
飞书小程序 |
京东小程序 |
× |
× |
× |
× |
H5-Safari |
Android Browser |
微信浏览器(Android) |
QQ浏览器(Android) |
Chrome |
IE |
Edge |
Firefox |
PC-Safari |
× |
× |
× |
× |
× |
× |
× |
× |
× |
sn-signin-weixin
ios配置Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>weixin</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wxbe7f03382358338d</string>
</array>
</dict>
</array>
</dict>
</plist>
其中wxbe7f03382358338d
改成你自己申请的微信appid
接口调用
uni-app调用
import { registerApp } from '@/uni_modules/sn-signin-weixin';
registerApp({
appId: 'wxbe7f03382358338d',
universalLink: ''
})
import { wxLogin } from '@/uni_modules/sn-signin-weixin';
wxLogin({
scope : "snsapi_userinfo", // 只能填 snsapi_userinfo
state : "123"
} ,e => {
if(e.success) {
// e.code
}
})
uni-app x调用
import * as WxSignIn from '@/uni_modules/sn-signin-weixin';
WxSignIn.registerApp({
appId: 'wx7f5d9e6c7c6a9d8d',
universalLink: 'test'
} as WxSignIn.WXApiRegInfo);
WxSignIn.wxLogin(
{
scope: 'snsapi_userinfo',
state: '123'
} as WxSignIn.WXApiSignInReq,
(e: WxSignIn.WXApiSignInResult) => {
if (e.success) {
}
}
);