wechat_bridge 0.3.0 copy "wechat_bridge: ^0.3.0" to clipboard
wechat_bridge: ^0.3.0 copied to clipboard

Flutter 版微信登录/分享/支付 SDK,API 与 wechat_kit 兼容。

wechat_bridge #

Flutter 版微信登录/分享/支付 SDK。API 与 wechat_kit 兼容,便于迁移。使用 Kotlin/Swift 实现,采用较新的微信 SDK。

功能特性 #

  • ✅ 微信授权登录
  • ✅ 分享(文本、图片、网页、小程序等)
  • ✅ 微信支付
  • ✅ 打开小程序
  • ✅ 一次性订阅消息
  • ✅ 扫码登录(Android)

安装 #

dependencies:
  wechat_bridge: ^0.1.0

配置 #

Android #

  • 微信开放平台 创建应用并获取 AppID
  • 应用签名需与开放平台配置一致

iOS #

使用示例 #

import 'package:wechat_bridge/wechat_bridge.dart';

// 注册
await WechatBridgePlatform.instance.registerApp(
  appId: 'your_app_id',
  universalLink: 'https://your-domain.com/wechat/',
);

// 监听回调
WechatBridgePlatform.instance.respStream().listen((resp) {
  if (resp is WechatAuthResp && resp.isSuccessful) {
    // 授权成功,使用 resp.code 换取 access_token
  }
  if (resp is WechatShareMsgResp && resp.isSuccessful) {
    // 分享成功
  }
  if (resp is WechatPayResp && resp.isSuccessful) {
    // 支付成功
  }
});

// 授权登录
await WechatBridgePlatform.instance.auth(
  scope: [WechatScope.kSNSApiUserInfo],
);

// 分享网页
await WechatBridgePlatform.instance.shareWebpage(
  scene: WechatScene.kSession,
  title: '标题',
  description: '描述',
  webpageUrl: 'https://example.com',
);

License #

MIT

1
likes
0
points
494
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter 版微信登录/分享/支付 SDK,API 与 wechat_kit 兼容。

Repository (GitHub)
View/report issues

Topics

#wechat #flutter #login #share #payment

License

unknown (license)

Dependencies

convert, crypto, flutter, plugin_platform_interface

More

Packages that depend on wechat_bridge

Packages that implement wechat_bridge