fluwx 2.0.7

  • Readme
  • Changelog
  • Example
  • Installing
  • 97

Fluwx #

pub package Build status #

logo

中文请移步此处

What's Fluwx #

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

Join QQ Group now: 892398530。

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.

Preparation #

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.

Watch Charged Video

Install #

Add the following dependencies in your pubspec.yaml file:

Fluwx with pay:

dependencies:
  fluwx: ^${latestVersion}

pub package

Fluwx without pay:

dependencies:
  fluwx_no_pay: ^${latestVersion}

pub package

NOTE: Never forget to replace ^${latestVersion} with actual version.

Register WxAPI #

Register your app via fluwx if necessary.

registerWxApi(appId: "wxd930ea5d5a228f5f",universalLink: "https://your.univerallink.com/link/");

The param universalLink only works with iOS. You can read this document to learn how to create universalLink. You can also learn how to add URL schema, how to add LSApplicationQueriesSchemes in your iOS project. This is essential.

For Android, you shall know to how generate signature for your app in this page. And you have to understand the difference between debug signature and release signature. Once the signature is incorrect, then you'll get errCode = -1.

Capability Document #

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

QA #

These questions maybe help

Buy the writer a cup of coffee。

Subscribe Us On WeChat #

subscribe

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.

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部分的分享已完成.

example/lib/main.dart

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:fluwx/fluwx.dart';

import 'auth_by_qr_code_page.dart';
import 'launch_mini_program_page.dart';
import 'pay_page.dart';
import 'send_auth.dart';
import 'share_image_page.dart';
import 'share_mini_program.dart';
import 'share_music.dart';
import 'share_text.dart';
import 'share_video_page.dart';
import 'share_web_page.dart';
import 'sign_auto_deduct_page.dart';
import 'subscribe_message_page.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    _initFluwx();
  }

  _initFluwx() async {
    await registerWxApi(
        appId: "wxd930ea5d5a258f4f",
        doOnAndroid: true,
        doOnIOS: true,
        universalLink: "https://your.univerallink.com/link/");
    var result = await isWeChatInstalled;
    print("is installed $result");
  }

// Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {}

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      routes: <String, WidgetBuilder>{
        "shareText": (context) => ShareTextPage(),
        "shareImage": (context) => ShareImagePage(),
        "shareWebPage": (context) => ShareWebPagePage(),
        "shareMusic": (context) => ShareMusicPage(),
        "shareVideo": (context) => ShareVideoPage(),
        "sendAuth": (context) => SendAuthPage(),
        "shareMiniProgram": (context) => ShareMiniProgramPage(),
        "pay": (context) => PayPage(),
        "launchMiniProgram": (context) => LaunchMiniProgramPage(),
        "subscribeMessage": (ctx) => SubscribeMessagePage(),
        "AuthByQRCode": (ctx) => AuthByQRCodePage(),
        'AutoDeduct': (ctx) => SignAutoDeductPage(),
      },
      home: new Scaffold(
          appBar: new AppBar(
            title: const Text('Plugin example app'),
          ),
          body: ShareSelectorPage()),
    );
  }
}

class ShareSelectorPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: new ListView(
        children: <Widget>[
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  Navigator.of(context).pushNamed("shareText");
                },
                child: const Text("share text")),
          ),
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  Navigator.of(context).pushNamed("shareImage");
                },
                child: const Text("share image")),
          ),
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  Navigator.of(context).pushNamed("shareWebPage");
                },
                child: const Text("share webpage")),
          ),
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  Navigator.of(context).pushNamed("shareMusic");
                },
                child: const Text("share music")),
          ),
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  Navigator.of(context).pushNamed("shareVideo");
                },
                child: const Text("share video")),
          ),
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  Navigator.of(context).pushNamed("shareMiniProgram");
                },
                child: const Text("share mini program")),
          ),
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  Navigator.of(context).pushNamed("sendAuth");
                },
                child: const Text("send auth")),
          ),
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  Navigator.of(context).pushNamed("pay");
                },
                child: const Text("pay")),
          ),
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  Navigator.of(context).pushNamed("launchMiniProgram");
                },
                child: const Text("Launch MiniProgram")),
          ),
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  Navigator.of(context).pushNamed("subscribeMessage");
                },
                child: const Text("SubscribeMessage")),
          ),
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  Navigator.of(context).pushNamed("AuthByQRCode");
                },
                child: const Text("AuthByQRCode")),
          ),
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  Navigator.of(context).pushNamed("AutoDeduct");
                },
                child: const Text("SignAuto-deduct")),
          ),
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  openWeChatApp();
                },
                child: const Text("Open WeChat App")),
          ),
        ],
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  fluwx: ^2.0.7

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:fluwx/fluwx.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
94
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
97
Learn more about scoring.

We analyzed this package on Mar 31, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test