说明

钉钉cordova插件(ANDROID(宋少平)\IOS(贾硕)),对外提供检测钉钉是否安装、钉钉登录功能,其他功能陆续集成,插件参考钉钉官网集成方式https://open-doc.dingtalk.com/microapp/native/oguxo2#android%E5%88%86%E4%BA%ABsdk%E6%8E%A5%E5%85%A5%E6%B5%81%E7%A8%8B,

下载

git clone http://tiger.m2plat.cn/cordova-plugin-dingtalk

安装

ionic cordova plugin add ../cordova-plugin-dingtalk/ —variable DINGTALKAPPID=”XXXXX”

使用

1.检测钉钉是否安装 Dingtalk.isInstalled((installed) => { //installed 1安装 0未安装 }, function (reason) { // alert(“Failed: “ + reason); }); 2.钉钉登录 const scope = “snslogin”, state = ““ + (+new Date()); const respSource = new Subject(); Dingtalk.auth(scope, state, (response) => { //response.code 钉钉返回临时授权码,通过此授权码可获取钉钉用户的unionId }, function (reason) { // alert(“Failed: “ + reason); });

卸载

ionic cordova plugin remove cordova-plugin-dingtalk