Giter Site home page Giter Site logo

fluwx_worker's Introduction

fluwx_worker

flutter版企业微信插件

使用说明

如果你用过flutter版微信插件,用这个就轻车熟路了,企业微信插件是按那个来封装的。 使用这个插件之前同样最好了解一下企业微信API,这个插件现在只实现了登录功能

注意:你的app要完成完整的登录流程,需要跟自己的服务端相配合,客户端的作用只是拉起企业微信完成授权,取回一个code。这个code相对应的用户信息是需要自己用这个code再发http请求去取回来的,按着企业微信服务端API去实现就是了。

这个插件没有发布到pub,加依赖只能用git方式

dependencies:
  fluwx_worker:
    git:
      url: https://github.com/lichfy/fluwx_worker

下面是主要代码

    import 'package:fluwx_worker/fluwx_worker.dart' as fluwxWorker;

   //初始化
   await fluwxWorker.register(schema: schema,corpId: corpId,agentId: agentId);
   var result = await fluwxWorker.isWeChatInstalled();  //判断是否已安装企业微信

   //企业微信授权
   fluwxWorker.sendAuth(schema: schema,appId: corpId,agentId: agentId);

   //等待授权结果
   fluwxWorker.responseFromAuth.listen((data) async {
     if (data.errCode == 0){
       _result = data.code;   //后续用这个code再发http请求取得UserID
     }else if (data.errCode == 1){
       _result = '授权失败';
     }else {
       _result = '用户取消';
     }
     setState(() {

     });
   });

fluwx_worker's People

Contributors

lichfy avatar suhli avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.