搜尋套件、儲存庫與 APP 分類

套件詳情v6.0.6

fluwx

在Flutter中實現微信SDK的功能。透過Fluwx,開發者可以輕鬆使用微信SDK,例如分享、付款、啟動小程式等。

AndroidiOS
近 30 天下載
2.1萬
喜歡數
278
Pub 分數
155

安裝套件

flutter pub add fluwx

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Fluwx 是一個 Flutter 套件,可將微信 SDK 功能整合至 Flutter 應用程式中。它簡化了在 Android 與 iOS 平台上使用微信功能的過程,例如分享內容、處理付款以及啟動小程式。專為針對中國市場的開發者設計,Fluwx 提供直覺的 API,讓開發者能在 Flutter 應用中運用微信生態系統。此套件由 openflutter.dev 維護,並可透過 pub.dev 取得。

適用情境

  • 微信應用分享
  • 應用內微信支付
  • 啟動微信小程式
  • 整合微信登入
  • 啟用微信社交功能

主要特色

  • 跨平台支援(Android 與 iOS)
  • 微信 SDK 的簡單 API
  • 支援分享、支付與小程式啟動
  • 由 openflutter.dev 持續維護
  • 官方微信 SDK 包裝器

適合對象

  • 面向中國的Flutter應用
  • 使用微信支付的電商應用
  • 與微信的社交媒體整合
  • 需要微信小程式存取權限的應用
  • 熟悉微信 SDK 的開發者

使用建議

  • 需要在裝置上安裝微信應用
  • 需要正確設定微信應用 ID
  • iOS 平台特定設定需要
  • 除了基本範例之外,文件內容有限
  • 依賴於微信 SDK 版本相容性

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Fluwx

pub package Build status GitHub stars GitHub forks GitHub license GitHub issues OpenFlutter


logo

中文请移步此处

What's Fluwx

Fluwx is flutter plugin for WeChatSDK which allows developers to call
WeChatSDK native APIs.

Join QQ Group now: 1003811176

QQGroup

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

Development Setup

Please read DEVELOPMENT.md for development setup.

Preparation

Migrate to V6 now

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}

pub package

[!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:

  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:

<key>CFBundleURLTypes</key>
	<array>
		<dict>
			<key>CFBundleTypeRole</key>
			<string>Editor</string>
			<key>CFBundleURLName</key>
			<string>weixin</string>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>wx123456789</string>
			</array>
		</dict>
	</array>
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.

It's better to register your API as early as possible.

Capability Document

For more capabilities, you can read the public functions of fluwx.

QA

These questions maybe help

Donate

Buy the writer a cup of coffee。

Subscribe Us On WeChat

subscribe

Star history

stars

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.

所屬分類

依賴

依賴清單 1 項

  • plugin_platform_interface^2.0.2

原始碼儲存庫

使用此套件的專案