diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index b1a8ffdc..0bdf9cbe 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -23,15 +23,7 @@ jobs: run: melos bootstrap - name: Verify symlinks - run: | - test -L packages/fluwx_no_pay/lib || (echo "❌ fluwx_no_pay/lib symlink missing" && exit 1) - test -L packages/fluwx/ios/fluwx/Sources/fluwx || (echo "❌ fluwx iOS Sources symlink missing" && exit 1) - test -L packages/fluwx_no_pay/ios/fluwx_no_pay/Sources/fluwx_no_pay || (echo "❌ fluwx_no_pay iOS Sources symlink missing" && exit 1) - test -L packages/fluwx/android/src/main/kotlin || (echo "❌ fluwx Android kotlin symlink missing" && exit 1) - test -L packages/fluwx_no_pay/android/src/main/kotlin || (echo "❌ fluwx_no_pay Android kotlin symlink missing" && exit 1) - test -L packages/fluwx/ohos || (echo "❌ fluwx/ohos symlink missing" && exit 1) - test -L packages/fluwx_no_pay/ohos || (echo "❌ fluwx_no_pay/ohos symlink missing" && exit 1) - echo "✅ 所有 symlink 完好" + run: melos run symlinks:check - name: Analyze run: melos exec --concurrency=1 -- flutter analyze --no-fatal-infos --no-fatal-warnings diff --git a/packages/fluwx/CHANGELOG.md b/packages/fluwx/CHANGELOG.md deleted file mode 100644 index a599646a..00000000 --- a/packages/fluwx/CHANGELOG.md +++ /dev/null @@ -1,841 +0,0 @@ -# 6.0.0-preview.3 -* 修复iOS编译错误 - -# 6.0.0-preview.2 -* iOS旧的回调加回来了 - -# 6.0.0-preview.1 -* Flutter 版本要求升级到3.38.0或更高 -* Dart 版本要求升级到3.10.0或更高 -* 支持UISceneDelegate。 - -# 5.7.5 -* 更新:鸿蒙端支持分享文件 -* 更新:鸿蒙端支持打开客服会话 -* 修复: 鸿蒙端分享小程序类型错误的问题 -* 完善鸿蒙端调试文档 - -# 5.7.4 -* 鸿蒙SDK升级至1.0.15 -* Fix #735 - -# 5.7.3 -* Kotlin 升级至2.1.0 - -# 5.7.2 -* Fix #723 - -# 5.7.1 -* iOS SDK升级至2.0.5 -* Android SDK升级至6.8.34 - -# 5.7.0 -* 修复debug_logging在Android端不生效的问题 -* Fix #716 - -# 5.6.0 -* Android和iOS支持Emoj分享 -* 文档完善 - -# 5.5.5 -* 鸿蒙SDK升级到1.0.14 -* 鸿蒙端支持分享视频 - -# 5.5.4 -* 分享到小程序时,增加scene字段,尽管微信只支持分享小程序到会话. - -# 5.5.3 -* Fix [#706](https://github.com/OpenFlutter/fluwx/issues/706) - -# 5.5.2 -* Fix [#703](https://github.com/OpenFlutter/fluwx/issues/703) - -# 5.5.1 -* 鸿蒙端bug修复,详见[PR](https://github.com/OpenFlutter/fluwx/pull/700) - -# 5.5.0 -* 更新鸿蒙sdk,支持openBusinessView,onWXLaunchFromWX - -# 5.4.2 -* 更新一下API文档 - -# 5.4.1 -* Android替换过时方法toLowerCase()为lowercase() - -# 5.4.0 -* 增加鸿蒙分享网页和小程序,微信sdk升级1.0.6 - -# 5.3.1 -* JVM target降低至11 - -# 5.3.0 -* 升级kotlin、gradle相关 -* 更新progurad规则(#672) - -# 5.2.7 -* 鸿蒙sdk升级到1.0.3 -* 鸿蒙支持分享至小程序 - -# 5.2.6 -* iOS脚本优化 - -# 5.2.5 -* 测试自动发布脚本 - -# 5.2.4 -* Fix #663 - -# 5.2.3 -* Fix #661 - -# 5.2.2 -* Fix #659,优化iOS脚本,使其更加友好 - -# 5.2.1 -* Merge #658 - -# 5.2.0 -* 为iOS分享小程序增加hdImageData选项 -* 优化Android图片分享逻辑,优先把LocalImagePath以最大限度保证图片质量 - -# 5.1.0 -* 试验性支持harmonyOS,目前受限于native sdk,只支持部分功能 - -# 5.0.3 -* 优化localImagePath处理,减轻非Android开发者的上手难度:localImagePath如果是以content://开头,则默认你已经挂载了相关路径的权限, -否则请务必保证该路径是文件实际保存路径,即Android层可以直接读取到该文件,以方便fluwx将文件拷贝到指定可用目录。 - -# 5.0.2 -* 删除subscribeResponse, unsubscribeResponse - -# 5.0.1 -* Fix #642 - -# 5.0.0 -* 使用了多端统一API,详情请点击[这里](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Share_and_Favorites/Android.html) -* 分享时所有的缩略图请使用`thumbData`字段 -* Fluwx不会再对任何图片进行压缩处理 - -# 4.6.0 -* Android SDK => 6.8.30 -* 分享新增基础字段:thumbData -* 分享新增基础字段:thumbDataHash - -# 4.5.6 -* Merge #639 - -# 4.5.5 -* iOS 最小版本支持为12.0 - -# 4.5.4 -* Merge #606 - -# 4.5.3 -* Merge #605 - -# 4.5.2 -* Android WechatSdk->6.8.28 -* iOS WeChatSdk->2.0.4 - -# 4.5.1 -* Merge #602: 增加iOS privacy manifest - -# 4.5.0 -* Fix #599 -* 破坏性更新:从4.5.0起,当分享图片到微信时,如果不支持FileProvider方式分享,Fluwx不再尝试申请WRITE_EXTERNAL_STORAGE权限,这意味着你需要自己处理权限问题。 - -# 4.4.10 -* Merge #596 - -# 4.4.9 -* Merge #591 -* - -# 4.4.8 -* Fix #543 - -# 4.4.7 -* Response里asRecord更名为toRecord. -* Response相关实体类的内容比较应该对比toRecord结果 - -# 4.4.6 -* Response里asString更名为asRecord. - -# 4.4.5 -* Response相关实体类增加asString方法,以方便debug. - -# 4.4.4 -* Android重写onReattachedToActivityForConfigChanges - -# 4.4.3 -* Fix #584 缩略图不显示问题 - -# 4.4.2 -* 修复iOS回调会与其他插件冲突的问题 - -# 4.4.1 -* Fix #575 - -# 4.4.0 -* universal_link 不再是必选项 - -# 4.3.2 -* iOS新增ignore_security选项,详见#576 - -# 4.3.1 -* Merge #574 - -# 4.3.0 -* Android minSdkVersion升级至19 -* 主要解决了 iOS 端的冷启动参数传递问题 - -# 4.2.7 - -* 修复在Flutter module中编译不过的问题 - -# 4.2.6 - -* Fix #549 - -# 4.2.5 - -* iOS支持解析包含Anchors & Alias的Yaml - -# 4.2.4+1 - -* 优化Android代码生成逻辑 - -# 4.2.4 - -* 修复iOS extMsg的问题 - -# 4.2.3 - -* 修复iOS冷启动extMsg的问题 - -# 4.2.2+1 - -* 更新iOS冷启动处理 - -# 4.2.2 - -* 删除iOS在registerApi并且开启debug_logging时自动自检 -* 为iOS增加自检方法selfCheck -* subscribeResponse, unsubscribeResponse已废弃。 -* 新增addSubscriber, removeSubscriber -* addSubscriber会返回Cancelable对象,可以直接调用cancel()函数。 - -# 4.2.1 - -* 支持选用scene_delegate. - -# 4.2.0 - -* 修复ios上微信唤醒app崩溃的问题 -* Android端重构 -* app_id不再必填 - -# 4.1.1+1 - -* Fix Android compile issue - -# 4.1.1 - -* 重构Android app_id处理 - -# 4.1.0 - -* 修复冷启动问题 -* iOS端代码清理 - -# 4.0.1+1 - -* 更新iOS引用方式 - -# 4.0.1 - -* Fix #531 - -# 4.0.0+2 - -* flutter: ">=3.3.0" - -# 4.0.0+1 - -* Fix iOS compile issue - -# 4.0.0 - -* 重构Flutter端,现在需要`Fluwx fluwx = Fluwx();`调用fluwx实例 -* 支持取消回传值的监听 -* 枚举例按照dart语言规范进行了重命名 -* 一些包含`WeChat`的方法删除了`WeChat` -* 部分类改为sealed class -* No_pay现已合并入Fluwx -* 将一些设置移到pubspec.yaml,具体可以参看`example/pubspec.yaml` -* 删除了log相关操作,因为现在可以通过yaml配置 -* 新增一些open功能 - -# 4.0.0-pre.3 - -* `Fluwx`接口优化。合并了一些函数以优化使用体验。 -* 修复Logging在iOS端不好的问题。 - -# 4.0.0-pre.2 - -* No_pay现已合并入Fluwx -* 将一些设置移到pubspec.yaml,具体可以参看`example/pubspec.yaml` -* 删除了log相关操作,因为现在可以通过yaml配置 -* 增加了open()方法并删除了openWeChatApp - -# 4.0.0-pre.1 - -* 重构Flutter端,现在需要`Fluwx fluwx = Fluwx();`调用fluwx实例 -* 支持取消回传值的监听 -* 枚举例按照dart语言规范进行了重命名 -* 一些包含`WeChat`的方法删除了`WeChat` -* 部分类改为sealed class -* 最低dart版本>=3.1.0-26.0.dev - -# 3.13.1 - -* 分享到小程序的thumbnail为必填 - -# 3.13.0 - -* Android SDK升级到6.8.24 -* Kotlin升级到1.7.10 -* iOS切换到WechatOpenSDK-XCFramework - -# 3.12.2 - -* Fix #509 - -# 3.12.1 - -* 升级AGP -* Fix #512 - -# 3.12.0 - -* 授权登录支持关闭自动授权 -* 分享支持添加签名,防止篡改 - -# 3.11.0+1 - -* Fix #506 - -# 3.11.0 - -* Fix #504 - -# 3.10.0 - -* 更新微信SDK - -# 3.9.2 - -* 修复分享图片会导致Android无反应问题 - -# 3.9.1 - -* Fix issue getting extData on iOS - -# 3.9.0+2 - -* Merge #485 - -# 3.9.0+1 - -* Merge #482 - -# 3.9.0 - -* 支持微信卡包 - -# 3.8.5 - -* Fix #471 - -# 3.8.4+3 - -* Fix #478 #466 #470 #472 - -# 3.8.4+2 - -* Fix #471 -* 更换pod源 - -# 3.8.4+1 - -* Fix #471 - -# 3.8.4 - -* 增加微信的日志开关 - -# 3.8.2+1 - -* 升级kotlin-coroutine - -# 3.8.2 - -* 新加自动订阅续费功能 - -# 3.8.1+1 - -* Just update docs - -# 3.8.1 - -* 在iOS中增加FluwxDelegate -* 尝试修复iOS冷启动获取extMsg问题 - -# 3.8.0+2 - -* Fix #461 - -# 3.8.0 - -* APP调起支付分-订单详情 - -# 3.7.0 - -* Fix #453 - -# 3.6.1+4 - -* Android P support - -# 3.6.1+3 - -* Fix #431 - -# 3.6.1+2 - -* Fix #422 - -# 3.6.1+1 - -* Fix #414 - -# 3.6.1 - -* Fix #415 - -# 3.6.0 - -* APP拉起微信客服功能 - -## 3.5.1 - -* 自动释放extMsg - -## 3.5.0 - -* update compileSdkVersion - -## 3.4.3 - -* update Android SDK version - -## 3.4.2 - -* Merge #370 - -## 3.4.1 - -* 修复热启动传值问题 - -## 3.4.0 - -* 修复从外部拉起App白屏问题 -* 修复从外部拉起App无法传值问题 - -## 3.3.2 - -* Fix #357 - -## 3.3.1 - -* Fix #354 - -## 3.3.0 - -* Null-safety support -* Fix #350 - -## 2.6.2 - -* Fix #338 on Android - -## 2.6.1 - -* Fix #338 - -## 2.6.0+2 - -* Remove trailing - -## 2.6.0+1 - -* Nothing - -## 2.6.0 - -* Android支持通过H5冷启动app传递中的extinfo数据 -* Android新加handleWeChatRequestByFluwx。 - -## 2.5.0+1 - -* Fix trailing , issue. - -## 2.5.0 - -* App获取开放标签中的extinfo数据 - -## 2.4.2 - -* Fix #317 - -## 2.4.1 - -* 修复Android 11无法分享图片的问题 - -## 2.4.0 - -* 支持compressThumbnail -* 升级OkHttp - -## 2.3.0 - -* 适配Flutter 1.20 -* 升级Android的Gradle以及更库的版本 - -## 2.2.0 - -* Merged #249 - -## 2.1.0 - -* Specifying supported platforms -* Fix: Android分享小程序时,缩略图压缩过重的问题 -* 更改分享文件的实现形式 - -## 2.0.9 - -* Android SDK 升级到6.6.4 -* iOS SDK升级到1.8.7.1 -* Kotlin->1.3.72 - -## 2.0.8+3 - -* Merge #218 - -## 2.0.8+2 - -* Merge #218 - -## 2.0.8+1 - -* 修复ios编译错误 - -## 2.0.8 - -* Fix #212 - -## 2.0.7 - -* Fix #207 - -## 2.0.6+2 - -* Fix: Android分享大图时存储权限问题 - -## 2.0.6 - -* Fix: Android请求权限崩溃的问题 - -## 2.0.5+1 - -* 升级 - -## 2.0.5 - -* Fix:Android分享file文件时,会crash - -## 2.0.4 - -* Fix:hdImage为空时,ios会crash - -## 2.0.3 - -* 添加混淆文件 - -## 2.0.2 - -* Fix #199 - -## 2.0.1 - -* 修复Android没有回调的问题 - -## 2.0.0+1 - -* 按照pub建议改进 - -## 2.0.0 - -* 代码重构,现在代码结构更清晰 -* 所有图片由WeChatImage构建 -* 现在iOS对分享微信小程序的高清图也会压缩 -* 微信回调监听形式变更 -* Android增加新的Action以防微信打开小程序出错不会返回原app的问题 -* iOS改用Pod引用微信SDK -* iOS隐藏一些header -* kotlin 1.3.70 - -## 1.2.1+2 - -* iOS的StringUtil重命名了 - -## 1.2.1+1 - -* Fix #178 - -## 1.2.1 - -* Fix #175 - -## 1.2.0 - -* 分享文件 -* compileSdkVersion 29 - -## 1.1.4 - -* 注册微信时会对universal link进行简单校验 - -## 1.1.3 - -* Fix #146 - -## 1.1.2 - -* Fix #122 - -## 1.1.1+1 - -* Android CompileSDKVersion 提升到28 - -### 1.1.1 - -* registerWxApi - -## 1.1.0 - -* iOS SDK升级至1.8.6.1,本版本开始支持universal link。 -* Android SDK更换至without-mat:5.4.3 -* Android配置升级 -* 移除MTA选项 - -## 1.0.6 - -* Fix #110 - -## 1.0.5 - -* 增加分享内存图片 - -## 1.0.4 - -* 解决Android上打开小程序返回白屏问题(非官方解决方案) - -## 1.0.3 - -* 修复一些小问题 - -## 1.0.2 - -* 修复无法Android上分享大图的问题 - -## 1.0.1 - -* 修复一些小问题 - -## 1.0.0 - -* ios不必再重写AppDelegate - -## 0.6.3 - -* 免密支付 -* 支持打开微信App了 -* 升级了Android - -## 0.6.2 - -* 对android进行了升级 - -## 0.6.1 - -* 支持二维码登录 - -## 0.6.0 - -* kotlin升级至1.3.21。 -* ios SDK升级至1.8.4。 -* android SDK升级至5.3.6。 - -## 0.5.7 - -* 修复问题43。 - -## 0.5.6 - -## 0.5.5 - -* 修复ios分享小程序标题不正确的问题。 - -## 0.5.4 - -* 增加一次性订阅消息功能。 - -## 0.5.3 - -* 修复唤起小程序返回值类型不一致的问题。 - -## 0.5.2 - -* 修复ios上sendAuth无返回的问题。 -* kotlin升级至1.3.10 -* android WeChatSDK升级到5.1.6 - -## 0.5.1 - -* Kotlin升级到了1.3.0 -* 代码格化 - -## 0.5.0 - -* 增加了对拉起小程序的支持 -* 删除了一些不必要的类 -* 发送Auth验证Api调整 - -## 0.4.1 - -* 修复iOS与其他库共存时,会有重复的错误 - -## 0.4.0 - -* 移除WeChatPayModel -* 移除ios最小支持。 -* 优化*Android*微信回调。 -* *build.gradle*升级到了*3.2.1*。 - -## 0.3.2 - -* *build.gradle*升级到了*3.2.0* -* *kotlin*升级到了*1.2.71* - -## 0.3.1 - -* 修复了由于Flutter-dev-0.9.7-pre在android中添加了*@Nullable*注解而引起的编译问题 - -## 0.3.0 - -* 回调方式发生变化,由Map变更为实体类。 -* iOS的WeChatSDK更换为内部依赖,并升级到了1.8.3。 -* 修复iOS支付返回结果缺少*returnKey*的问题。 -* API现在更加友善了。 -* 对swift支持更友好了。 - -## 0.2.1 - -* 修复在Android处理网络图片后缀不对的问题。 - -## 0.2.0 - -* iOS支持Swift了。 - -## 0.1.9 - -* 修复了不传*thumbnail*在Android上会崩溃的bug。 - -## 0.1.8 - -* `WeChatPayModel`里的字段不再是`dynamic`。 -* 修复了iOS对支付功能中timestamp处理不正确的问题。 - -## 0.1.7 - -* 删除`Fluwx.registerApp(RegisterModel)`,现在使用`Fluwx.register()`。 - -## 0.1.6 - -* 修复transitive dependencies。 - -## 0.1.5 - -* 增加了本地图片的支持 - -## 0.1.4 - -* 修复了iOS分享去处错误的问题 - -## 0.1.3 - -* `ResponseType` 更名为`WeChatResponseType` - -## 0.1.2 - -* 修复iOS中FluwxShareHandler.h的导入问题 - -## 0.1.1 - -* 修复iOS分享去处错误的bug - -## 0.1.0 - -* 增加了MTA选项 -* Android部分的微信SDK提供方式由implementation更换为api - -## 0.0.8 - -* 修复了iOS无法分享小程序的bug -* 修复了iOS分享音乐崩溃的问题 -* 修复了iOS发送Auth偶尔会崩溃的问题 - -## 0.0.7 - -* 修复了iOS回调崩溃的bug - -## 0.0.6 - -* 修复iOS拉起支付崩溃的问题 - -## 0.0.5 - -* 格式化代码 - -## 0.0.4 - -* 支付 -* demo - -## 0.0.3 - -* 发送Auth认证。 - -## 0.0.2 - -* 文本分享。 -* 网站分享。 -* 图片分享。 -* 音乐分享。 -* 视频分享。 -* 小程序分享。 - -## 0.0.1 - -* Android部分的分享已完成. diff --git a/packages/fluwx/CHANGELOG.md b/packages/fluwx/CHANGELOG.md new file mode 120000 index 00000000..699cc9e7 --- /dev/null +++ b/packages/fluwx/CHANGELOG.md @@ -0,0 +1 @@ +../../CHANGELOG.md \ No newline at end of file diff --git a/packages/fluwx/README.md b/packages/fluwx/README.md deleted file mode 100644 index 3714ebdc..00000000 --- a/packages/fluwx/README.md +++ /dev/null @@ -1,203 +0,0 @@ -# Fluwx - -[![pub package](https://img.shields.io/pub/v/fluwx.svg)](https://pub.dev/packages/fluwx) -![Build status](https://github.com/OpenFlutter/fluwx/actions/workflows/build_test.yml/badge.svg) -[![GitHub stars](https://img.shields.io/github/stars/OpenFlutter/fluwx)](https://github.com/OpenFlutter/fluwx/stargazers) -[![GitHub forks](https://img.shields.io/github/forks/OpenFlutter/fluwx)](https://github.com/OpenFlutter/fluwx/network) -[![GitHub license](https://img.shields.io/github/license/OpenFlutter/fluwx)](https://github.com/OpenFlutter/fluwx/blob/master/LICENSE) -[![GitHub issues](https://img.shields.io/github/issues/OpenFlutter/fluwx)](https://github.com/OpenFlutter/fluwx/issues) -OpenFlutter - ---- - -![logo](https://gitee.com/OpenFlutter/resoures-repository/raw/master/fluwx/fluwx_logo.png) - -[中文请移步此处](./README_CN.md) - -## What's Fluwx - -`Fluwx` is flutter plugin for [WeChatSDK](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Resource_Center_Homepage.html) which allows developers to call -[WeChatSDK](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Resource_Center_Homepage.html) native APIs. - -> Join QQ Group now: 1003811176 - -![QQGroup](https://gitee.com/OpenFlutter/resoures-repository/raw/master/common/flutter.png) - -## Capability - -- Share images, texts, music and so on to WeChat, including session, favorite and timeline. -- Payment with WeChat. -- Get auth code before you login in with WeChat. -- Launch mini program in WeChat. -- Subscribe Message. -- Just open WeChat app. -- Launch app From wechat link. -- Open Customer Service - -## Preparation - -[Migrate to V4 now](./doc/MIGRATE_TO_V4_CN.md) - -> Breaking changes :*Fluwx* won't request permission(WRITE_EXTERNAL_STORAGE) since 4.5.0. That means you will need to handle permission when sharing images, if FileProvider is not supported. - -`Fluwx` is good but not God. You'd better read [official documents](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Resource_Center_Homepage.html) before -integrating `Fluwx`. Then you'll understand how to generate Android signature, what's universal link for iOS, how to add URL schema for iOS and so on. - -## Install - -Add the `fluwx` package (with payment feature by default) in your `pubspec.yaml` file: - -`fluwx` with pay: - -```yaml -dependencies: - fluwx: ^${latestVersion} -``` - -![pub package](https://img.shields.io/pub/v/fluwx.svg) - -> [!WARNING] -> Never forget to replace ^${latestVersion} with an actual version!
-> (See the above version, or go to [versions](https://pub.dev/packages/fluwx/versions) on pub.dev) - -> [!NOTE] -> `fluwx` without pay:
-> Developers who need to exclude payment for iOS can set `no_pay: true` in the `fluwx` section of `pubspec.yaml`.
-> See the example: [example/pubspec.yaml](./example/pubspec.yaml#L19)
- -## Configurations - -`Fluwx` enables multiple configurations in the section `fluwx` of `pubspec.yaml` from v4, you can reference [pubspec.yaml](./example/pubspec.yaml#L10) -for more details. - -> For iOS, some configurations, such as url_scheme,universal_link, LSApplicationQueriesSchemes, can be configured by `fluwx`, -> what you need to do is to fill configurations in `pubspec.yaml` - -- app_id. Recommend. It'll be used to generate scheme on iOS。This is not used to init WeChat SDK so you still need to call `fluwx.registerApi` manually. -- debug_logging. Optional. Enable logs by setting it `true`. -- flutter_activity. Optional. This is usually used by cold boot from WeChat on Android. `Fluwx` will try to launch launcher activity if not set. -- universal_link. Recommend for iOS. It'll be used to generate universal link on your projects. -- scene_delegate. Optional. Use `AppDelegate` or `SceneDelegate`. See [official documents](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Access_Guide/iOS.html) for more details. - -- For iOS - If you are failing `cannot load such file -- plist` on iOS, please do the following steps: - -```shell -# step.1 install missing dependencies -sudo gem install plist -# step.2 enter iOS folder(example/ios/,ios/) -cd example/ios/ -# step.3 execute -pod install -``` - -- On OpenHarmony, to check if WeChat is installed, add the following to the module.json5 in your project - -```json5 -{ - "module": { - "querySchemes": [ - "weixin" - ], - } -} -``` - -> HarmonyOS Debugging Notice: Do not use the IDE's automatic signing. You must manually apply for a debug certificate for signing and debugging. - -## Register WxAPI - -Register your app via `fluwx` if necessary. - -```dart -Fluwx fluwx = Fluwx(); -final success = fluwx.registerApi(appId: "wxd930ea5d5a228f5f",universalLink: "https://your.univerallink.com/link/"); -print("register API success: $success"); -``` -### iOS -The parameter `universalLink` only works with iOS. You can read [this document](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Access_Guide/iOS.html) to learn -how to create universalLink and what additional configuration is needed on iOS. In what follows is a summary: - -1. A valid iOS universal link for this app is needed. - -2. Make sure the app has the entitlement Associated domains enabled - -3. Add or modify `LSApplicationQueriesSchemes` in Info.plist in your iOS project. This is essential. The following strings should be added: `weixin`, `wechat`, `weixinULAPI` and `weixinURLParamsAPI`. - -4. Add or modify `CFBundleURLTypes` in Info.plist in your iOS project. Add a URL type with name `weixin` and role `editor`. Put your WeChat App ID in URL Schemes. -Example how this looks like in Info.plist after modifying via XCode: -```xml -CFBundleURLTypes - - - CFBundleTypeRole - Editor - CFBundleURLName - weixin - CFBundleURLSchemes - - wx123456789 - - - -``` - - -### Android -Make sure the MD5 fingerprint of the signature of your app -is registered at WeChat. You can extract this signature from your `keystore` using Java's keytool. - -In debug mode your app is signed with a debug key from the development machine which will not be recognized by WeChat and you'll get `errCode = -1`. If you want to test in debug mode you will have to modify your debug key - -You can read more about it on [this page](https://developers.weixin.qq.com/doc/oplatform/Downloads/Android_Resource.html). - - -It's better to register your API as early as possible. - -## Capability Document - -- [Basic knowledge](./doc/BASIC_KNOWLEDGE.md) -- [Share](./doc/SHARE.md) -- [Payment](./doc/PAYMENT.md) -- [Auth](./doc/AUTH.md) -- [Launch app from h5](./doc/LAUNCH_APP_FROM_H5.md) -- [Open Customer Service](/doc/Customer_Service.md) - -For more capabilities, you can read the public functions of `fluwx`. - -## QA - -[These questions maybe help](./doc/QA_CN.md) - -## Donate - -Buy the writer a cup of coffee。 - - - -## Subscribe Us On WeChat - -![subscribe](https://gitee.com/OpenFlutter/resoures-repository/raw/master/fluwx/wx_subscription.png) - -## Star history - -![stars](https://starchart.cc/OpenFlutter/fluwx.svg) - -## LICENSE - - Copyright 2023 OpenFlutter Project - - Licensed to the Apache Software Foundation (ASF) under one or more contributor - license agreements. See the NOTICE file distributed with this work for - additional information regarding copyright ownership. The ASF licenses this - file to you under the Apache License, Version 2.0 (the "License"); you may not - use this file except in compliance with the License. You may obtain a copy of - the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - License for the specific language governing permissions and limitations under - the License. diff --git a/packages/fluwx/README.md b/packages/fluwx/README.md new file mode 120000 index 00000000..fe840054 --- /dev/null +++ b/packages/fluwx/README.md @@ -0,0 +1 @@ +../../README.md \ No newline at end of file diff --git a/packages/fluwx/README_CN.md b/packages/fluwx/README_CN.md deleted file mode 100644 index 211a9a78..00000000 --- a/packages/fluwx/README_CN.md +++ /dev/null @@ -1,165 +0,0 @@ -# Fluwx - -[![pub package](https://img.shields.io/pub/v/fluwx.svg)](https://pub.dartlang.org/packages/fluwx) -![Build status](https://github.com/OpenFlutter/fluwx/actions/workflows/build_test.yml/badge.svg) -[![GitHub stars](https://img.shields.io/github/stars/OpenFlutter/fluwx)](https://github.com/OpenFlutter/fluwx/stargazers) -[![GitHub forks](https://img.shields.io/github/forks/OpenFlutter/fluwx)](https://github.com/OpenFlutter/fluwx/network) -[![GitHub license](https://img.shields.io/github/license/OpenFlutter/fluwx)](https://github.com/OpenFlutter/fluwx/blob/master/LICENSE) -[![GitHub issues](https://img.shields.io/github/issues/OpenFlutter/fluwx)](https://github.com/OpenFlutter/fluwx/issues) -OpenFlutter - ---- - -![logo](https://gitee.com/OpenFlutter/resoures-repository/raw/master/fluwx/fluwx_logo.png) - -## 什么是Fluwx - -`Fluwx` 是一个[微信SDK](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Resource_Center_Homepage.html)插件,它允许开发者调用 -[微信原生SDK](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Resource_Center_Homepage.html). - -> 加入我们的QQ群: 1003811176 - -![QQGroup](https://gitee.com/OpenFlutter/resoures-repository/raw/master/common/flutter.png) - -## 能力 - -- 分享图片,文本,音乐,视频等。支持分享到会话,朋友圈以及收藏. -- 微信支付. -- 在微信登录时,获取Auth Code. -- 拉起小程序. -- 订阅消息. -- 打开微信. -- 从微信标签打开应用 -- APP拉起客服微信 - -## 准备 - -[迁移到V4指南](./doc/MIGRATE_TO_V4_CN.md) - -> 破坏性更新 :从4.5.0起,当分享图片到微信时,如果不支持FileProvider方式分享,Fluwx不再尝试申请WRITE_EXTERNAL_STORAGE权限,这意味着你需要自己处理权限问题。 - -`Fluwx` 可以做很多工作但不是所有. 在集成之前,最好读一下[官方文档](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Resource_Center_Homepage.html). - 然后你才知道怎么生成签名,怎么使用universal link以及怎么添加URL schema等. - -## 安装 - -在`pubspec.yaml` 文件中添加 `fluwx` 依赖(默认带支付功能): - -```yaml -dependencies: - fluwx: ^${latestVersion} -``` - -![pub package](https://img.shields.io/pub/v/fluwx.svg) - -> [!WARNING] -> 别忘记替换 ^${latestVersion} !为 `fluwx` 的发布版本!
-> (参考上面的版本号,或pub.dev 上的 [versions](https://pub-web.flutter-io.cn/packages/fluwx/versions)) - -> [!NOTE] -> 不带支付的 `fluwx`:
-> 一些开发者并不需要在 iOS 端使用支付能力,此时您只需要在 pubspec.yaml 的 `fluwx` 部分设置 `no_pay: true` 来去除支付能力。
-> 参考文件:[example/pubspec.yaml](./example/pubspec.yaml#L19)
- -## 配置 - -`Fluwx` 从v4开始可以在`pubspec.yaml`的`fluwx`进行一些配置。具体可以参考[pubspec.yaml](./example/pubspec.yaml#L10)。 - -> V4开始,iOS中的url_scheme,universal_link, LSApplicationQueriesSchemes可以不必开发者手动配动。只需在`pubspec.yaml` -> 中填写即可。 - -- app_id. 推荐. 它将用于生成iOS的url_scheme。这并不会替你初始化微信SDK,所以你还是自己调用`fluwx.registerApi`。 -- debug_logging. 可选. 把它设置成`true`可以开启日志。 -- flutter_activity. 可选. 这个通常是用于Android的冷启动。如果不设置任何值,`Fluwx`将尝试启动launcher activity. -- universal_link. iOS 推荐. 它将用自动配置universal_link。 -- scene_delegate. iOS 可选. 使用 `AppDelegate` 还是使用 `SceneDelegate`. 查阅[官方文档](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Access_Guide/iOS.html)了解更多. - -- For iOS -如果你在iOS上遇到了 `cannot load such file -- plist`, 请按照以下步骤进行操作: - -```shell -# step.1 安装必要依赖 -sudo gem install plist -# step.2 进行iOS文件夹(example/ios/,ios/) -cd example/ios/ -# step.3 执行脚本 -pod install -``` - -- 在 OpenHarmony 上,要检查微信是否已安装,请在项目的 module.json5 中添加以下内容 - -```json5 -{ - "module": { - "querySchemes": [ - "weixin" - ], - } -} -``` - -> HarmonyOS 调试须知:不要使用 IDE 的自动签名,务必手动申请调试证书进行签名并调试 - -## 注册 WxAPI - -通过 `fluwx` 注册WxApi. - -```dart -Fluwx fluwx = Fluwx(); -fluwx.registerApi(appId: "wxd930ea5d5a228f5f",universalLink: "https://your.univerallink.com/link/"); -``` - -参数 `universalLink` 只在iOS上有用. 查看[文档](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Access_Guide/iOS.html) 以便了解如何生成通用链接. - 你也可以学习到怎么在iOS工程中添加URL schema,怎么添加`LSApplicationQueriesSchemes`。这很重要。 - -对于Android, 可以查看[本文](https://developers.weixin.qq.com/doc/oplatform/Downloads/Android_Resource.html)以便了解怎么获取app签名. -然后你需要知道release和debug时,app签名有什么区别。如果签名不对,你会得一个错误 `errCode = -1`. - -建议越早注册越好。 - -## 能力文档 - -- [基础知识](./doc/BASIC_KNOWLEDGE_CN.md) -- [分享](./doc/SHARE_CN.md) -- [支付](./doc/PAYMENT_CN.md) -- [登录](./doc/AUTH_CN.md) -- [从微信标签打开应用](./doc/LAUNCH_APP_FROM_H5_CN.md) -- [APP拉起客服微信](/doc/Customer_Service_CN.md) -对于更多功能,可以查看源码。 - -## QA - -[这些问题可能对你有帮助](./doc/QA_CN.md) - -## 捐助 - -开源不易,请作者喝杯咖啡。 - - - -## 关注公众号 - -![subscribe](https://gitee.com/OpenFlutter/resoures-repository/raw/master/fluwx/wx_subscription.png) - -## 关注趋势 - -![stars](https://starchart.cc/OpenFlutter/fluwx.svg) - -## LICENSE - - Copyright 2018 OpenFlutter Project - - Licensed to the Apache Software Foundation (ASF) under one or more contributor - license agreements. See the NOTICE file distributed with this work for - additional information regarding copyright ownership. The ASF licenses this - file to you under the Apache License, Version 2.0 (the "License"); you may not - use this file except in compliance with the License. You may obtain a copy of - the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - License for the specific language governing permissions and limitations under - the License. diff --git a/packages/fluwx/README_CN.md b/packages/fluwx/README_CN.md new file mode 120000 index 00000000..aa307bce --- /dev/null +++ b/packages/fluwx/README_CN.md @@ -0,0 +1 @@ +../../README_CN.md \ No newline at end of file diff --git a/packages/fluwx/lib/src/method_channel/fluwx_platform_interface.dart b/packages/fluwx/lib/src/method_channel/fluwx_platform_interface.dart index e3f28344..1b6c8fff 100644 --- a/packages/fluwx/lib/src/method_channel/fluwx_platform_interface.dart +++ b/packages/fluwx/lib/src/method_channel/fluwx_platform_interface.dart @@ -18,7 +18,8 @@ */ import 'package:plugin_platform_interface/plugin_platform_interface.dart'; -import '../../fluwx.dart'; +import '../foundation/arguments.dart'; +import '../response/wechat_response.dart'; import 'fluwx_method_channel.dart'; abstract class FluwxPlatform extends PlatformInterface { diff --git a/packages/fluwx_no_pay/CHANGELOG.md b/packages/fluwx_no_pay/CHANGELOG.md new file mode 120000 index 00000000..699cc9e7 --- /dev/null +++ b/packages/fluwx_no_pay/CHANGELOG.md @@ -0,0 +1 @@ +../../CHANGELOG.md \ No newline at end of file diff --git a/packages/fluwx_no_pay/README.md b/packages/fluwx_no_pay/README.md new file mode 120000 index 00000000..fe840054 --- /dev/null +++ b/packages/fluwx_no_pay/README.md @@ -0,0 +1 @@ +../../README.md \ No newline at end of file diff --git a/packages/fluwx_no_pay/README_CN.md b/packages/fluwx_no_pay/README_CN.md new file mode 120000 index 00000000..aa307bce --- /dev/null +++ b/packages/fluwx_no_pay/README_CN.md @@ -0,0 +1 @@ +../../README_CN.md \ No newline at end of file diff --git a/packages/fluwx_no_pay/example/lib/fluwx_compat.dart b/packages/fluwx_no_pay/example/lib/fluwx_compat.dart index a688379b..713392a3 100644 --- a/packages/fluwx_no_pay/example/lib/fluwx_compat.dart +++ b/packages/fluwx_no_pay/example/lib/fluwx_compat.dart @@ -1,2 +1,2 @@ // fluwx_no_pay 适配层 — 共享 example 代码通过此文件引入正确的包 -export 'package:fluwx_no_pay/fluwx.dart'; +export 'package:fluwx_no_pay/fluwx_no_pay.dart'; diff --git a/packages/fluwx_no_pay/lib b/packages/fluwx_no_pay/lib deleted file mode 120000 index 92869342..00000000 --- a/packages/fluwx_no_pay/lib +++ /dev/null @@ -1 +0,0 @@ -../fluwx/lib \ No newline at end of file diff --git a/packages/fluwx_no_pay/lib/fluwx_no_pay.dart b/packages/fluwx_no_pay/lib/fluwx_no_pay.dart new file mode 100644 index 00000000..a66157c2 --- /dev/null +++ b/packages/fluwx_no_pay/lib/fluwx_no_pay.dart @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2023. OpenFlutter Project + * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor + * license agreements. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +/// Fluwx no-pay variant. +/// +/// This package exposes the same Dart API as `fluwx`, while the iOS native +/// package links the no-payment WeChat SDK. +library fluwx_no_pay; + +export 'src/fluwx.dart'; +export 'src/foundation/arguments.dart'; +export 'src/foundation/cancelable.dart' hide FluwxCancelableImpl; +export 'src/response/wechat_response.dart'; +export 'src/wechat_enums.dart'; +export 'src/wechat_file.dart' hide FileSchema; diff --git a/packages/fluwx_no_pay/lib/src b/packages/fluwx_no_pay/lib/src new file mode 120000 index 00000000..010c71c3 --- /dev/null +++ b/packages/fluwx_no_pay/lib/src @@ -0,0 +1 @@ +../../fluwx/lib/src \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index d5c1fccd..f258d7ca 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -43,7 +43,8 @@ melos: symlinks:check: run: | - test -L packages/fluwx_no_pay/lib || (echo "❌ fluwx_no_pay/lib symlink missing" && exit 1) + test -L packages/fluwx_no_pay/lib/src || (echo "❌ fluwx_no_pay/lib/src symlink missing" && exit 1) + test -f packages/fluwx_no_pay/lib/fluwx_no_pay.dart || (echo "❌ fluwx_no_pay library entrypoint missing" && exit 1) test -L packages/fluwx/ios/fluwx/Sources/fluwx || (echo "❌ fluwx iOS Sources symlink missing" && exit 1) test -L packages/fluwx_no_pay/ios/fluwx_no_pay/Sources/fluwx_no_pay || (echo "❌ fluwx_no_pay iOS Sources symlink missing" && exit 1) test -L packages/fluwx/ios/fluwx/CocoaPodsSources/fluwx/FluwxPlugin.m || (echo "❌ fluwx CocoaPods source symlink missing" && exit 1) diff --git a/tools/setup_examples.sh b/tools/setup_examples.sh index 45e0a2de..b38908c4 100644 --- a/tools/setup_examples.sh +++ b/tools/setup_examples.sh @@ -73,7 +73,7 @@ EOF cat > packages/fluwx_no_pay/example/lib/fluwx_compat.dart << 'EOF' // fluwx_no_pay 适配层 — 共享 example 代码通过此文件引入正确的包 -export 'package:fluwx_no_pay/fluwx.dart'; +export 'package:fluwx_no_pay/fluwx_no_pay.dart'; EOF echo " ✅ fluwx_compat.dart 写入完毕"