The capability of implementing WeChat SDKs in Flutter. With Fluwx, developers can use WeChatSDK easily, such as sharing, payment, lanuch mini program and etc.
Package selection guidance compiled from public package information, community data, and project usage.
Fluwx is a Flutter package that enables integration of WeChat SDK functionalities into Flutter applications. It simplifies the use of WeChat's features such as sharing content, processing payments, and launching mini programs on both Android and iOS platforms. Designed for developers targeting Chinese markets, Fluwx provides a straightforward API to leverage WeChat’s ecosystem within Flutter apps. The package is maintained by openflutter.dev and is available via pub.dev.
Use cases
WeChat app sharing
In-app WeChat payments
Launching WeChat mini programs
Integrating WeChat login
Enabling WeChat social features
Key features
Cross-platform support (Android & iOS)
Simple API for WeChat SDK
Supports sharing, payment, and mini program launch
Active maintenance by openflutter.dev
Official WeChat SDK wrapper
Suitable for
Flutter apps targeting China
E-commerce apps using WeChat Pay
Social media integrations with WeChat
Apps requiring WeChat mini program access
Developers familiar with WeChat SDK
Considerations
Requires WeChat app installation on device
Needs proper WeChat app ID configuration
Platform-specific setup needed for iOS
Limited documentation beyond basic examples
Dependent on WeChat SDK version compatibility
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
NOTE: V6 has a lot of breaking changes, especially for iOS, such as supporting scene_delegate and Swift Package Manager. Please read the document carefully before migrating to V6.
Fluwx is good but not God. You'd better read official documents 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:
dependencies:fluwx:^${latestVersion}
[!WARNING]
Never forget to replace ^${latestVersion} with an actual version!
(See the above version, or go to versions on pub.dev)
[!WARNING]
For no_pay version, you will need switch to fluwx_no_pay package, which is a separate package without payment features.
Configurations
Fluwx enables multiple configurations in the section fluwx of pubspec.yaml from v4, you can reference pubspec.yaml
for more details.
app_id. 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. It's not working on iOS for now.
flutter_activity. Optional. This is usually used by cold boot from WeChat on Android. Fluwx will try to launch launcher activity if not set.
On OpenHarmony, to check if WeChat is installed, add the following to the module.json5 in your project
{"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.
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 to learn
how to create universalLink and what additional configuration is needed on iOS. In what follows is a summary:
A valid iOS universal link for this app is needed.
Make sure the app has the entitlement Associated domains enabled
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.
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:
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
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.