All Projects → xu-li → Cordova Plugin Wechat

xu-li / Cordova Plugin Wechat

A cordova plugin, a JS version of Wechat SDK

Projects that are alternatives of or similar to Cordova Plugin Wechat

Cordova Plugin Linkedin
Cordova plugin for LinkedIn
Stars: ✭ 17 (-98.58%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Permissionscope
🔓 Cordova plugin to handle iOS permissions
Stars: ✭ 27 (-97.75%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Disable Bitcode
Cordova plugin to disable bitcode in iOS build settings
Stars: ✭ 19 (-98.41%)
Mutual labels:  cordova, cordova-plugin
Cordova Admob Pro
🔥 Cordova Plugin for Google AdMob, DFP, ADX. Easy monetization using mobile Ad, with single line of JavaScript. Compatible with Cordova CLI, Inoic, PhoneGap Build, etc.
Stars: ✭ 690 (-42.4%)
Mutual labels:  cordova, cordova-plugin
Tom Vpr
how does voiceprint recognition work in wechat page
Stars: ✭ 37 (-96.91%)
Mutual labels:  wechat-sdk, wechat
Python Weixin
微信(weixin|wechat) Python SDK 支持开放平台和公众平台 支持微信小程序云开发
Stars: ✭ 746 (-37.73%)
Mutual labels:  wechat-sdk, wechat
Entwechat
📦 WeChat Enterprise SDK based on EasyWeChat 3.X
Stars: ✭ 12 (-99%)
Mutual labels:  wechat-sdk, wechat
Cordova Plugin Camera Preview
Cordova plugin that allows camera interaction from HTML code
Stars: ✭ 528 (-55.93%)
Mutual labels:  cordova, cordova-plugin
Ionic4
This repo contains example code for ionic4. Get Step by Step tutorial of this repo examples using https://ampersandacademy.com/tutorials/ionic-framework-4
Stars: ✭ 37 (-96.91%)
Mutual labels:  cordova, cordova-plugin
Cl.kunder.webview
This cordova plugin enables you to open a second webview
Stars: ✭ 36 (-96.99%)
Mutual labels:  cordova, cordova-plugin
Diplomat
整合第三方 SDK 微信、微博、 QQ 等为统一的 Diplomat 接口。
Stars: ✭ 672 (-43.91%)
Mutual labels:  wechat-sdk, wechat
Gopay
QQ、微信(WeChat)、支付宝(AliPay)的Go版本SDK。【微信支付V3已支持,推荐使用微信V3接口】
Stars: ✭ 1,034 (-13.69%)
Mutual labels:  wechat-sdk, wechat
Wechat Php Sdk
PHP微信SDK(微信平台 + 微信支付)
Stars: ✭ 637 (-46.83%)
Mutual labels:  wechat-sdk, wechat
Weixin Java Miniapp Demo
基于Spring Boot 和 WxJava 实现的微信小程序Java后端Demo
Stars: ✭ 779 (-34.97%)
Mutual labels:  wechat-sdk, wechat
Wechatcmd
提供微信终端版本、微信命令行版本聊天功能、微信机器人
Stars: ✭ 628 (-47.58%)
Mutual labels:  wechat-sdk, wechat
Weixinmpsdk
微信全平台 SDK Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 6.0。已支持微信公众号、小程序、小游戏、企业号、企业微信、开放平台、微信支付、JSSDK、微信周边等全平台。 WeChat SDK for C#.
Stars: ✭ 7,098 (+492.49%)
Mutual labels:  wechat-sdk, wechat
Cordova Plugin Qrscanner
A fast, energy efficient, highly-configurable QR code scanner for Cordova apps and the browser.
Stars: ✭ 485 (-59.52%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Admob Free
Cordova AdMob Plugin
Stars: ✭ 508 (-57.6%)
Mutual labels:  cordova, cordova-plugin
Awesome Cordova Plugins
A curated list of awesome Cordova Apache Plugins https://cordova.apache.org/plugins/
Stars: ✭ 33 (-97.25%)
Mutual labels:  cordova, cordova-plugin
Blinkid Cordova
ID scanning for cross-platform apps built with Cordova and Phonegap.
Stars: ✭ 44 (-96.33%)
Mutual labels:  cordova, cordova-plugin

Active Downloads version

重要说明

Due to the security upgrade of iOS 13 system version, the official WeChat SDK has been adapted from 1.8.6 with supports * Universal Links * mode jumps, and the validity check when sharing.

From version 3.0.0 of our plugin, we changed to the latest WeChat SDK. Before using it, you need to configure the Universal Links service, and pay attention to passing the universallink variable when installing the plugin, otherwise it will not work properly.

If you don't want to use the new version features, you can fall back to version 3.0.0 prior

cordova-plugin-wechat

A cordova plugin, a JS version of Wechat SDK

Feature

  • check wechat client is installed;
  • Share text, image, link,music,video,miniprogram to wechat timeline,session or favorite;
  • open wechat auth;
  • send wechat payment request;
  • open wechat miniprogram;

Documentation

文档 · 教程 · FAQ · DEMO

Install

cordova plugin add cordova-plugin-wechat  --variable wechatappid=YOUR_WECHAT_APPID --variable universallink=YOUR_UNIVERSAL_LINK
cordova build ios
cordova build android

Usage

Check if wechat is installed

Wechat.isInstalled(function (installed) {
    alert("Wechat installed: " + (installed ? "Yes" : "No"));
}, function (reason) {
    alert("Failed: " + reason);
});

Authenticate using Wechat

var scope = "snsapi_userinfo",
    state = "_" + (+new Date());
Wechat.auth(scope, state, function (response) {
    // you may use response.code to get the access token.
    alert(JSON.stringify(response));
}, function (reason) {
    alert("Failed: " + reason);
});

Share text

Wechat.share({
    text: "This is just a plain string",
    scene: Wechat.Scene.TIMELINE   // share to Timeline
}, function () {
    alert("Success");
}, function (reason) {
    alert("Failed: " + reason);
});

Share media(e.g. link, photo, music, video etc)

Wechat.share({
    message: {
        title: "Hi, there",
        description: "This is description.",
        thumb: "www/img/thumbnail.png",
        mediaTagName: "TEST-TAG-001",
        messageExt: "这是第三方带的测试字段",
        messageAction: "<action>dotalist</action>",
        media: "YOUR_MEDIA_OBJECT_HERE"
    },
    scene: Wechat.Scene.TIMELINE   // share to Timeline
}, function () {
    alert("Success");
}, function (reason) {
    alert("Failed: " + reason);
});

Share link

Wechat.share({
    message: {
        ...
        media: {
            type: Wechat.Type.WEBPAGE,
            webpageUrl: "http://www.jason-z.com"
        }
    },
    scene: Wechat.Scene.TIMELINE   // share to Timeline
}, function () {
    alert("Success");
}, function (reason) {
    alert("Failed: " + reason);
});

Share mini program

Wechat.share({
    message: {
        ...
        media: {
            type: Wechat.Type.MINI,
            webpageUrl: "https://www.jason-z.com", // 兼容低版本的网页链接
            userName: "wxxxxxxxx", // 小程序原始id
            path: "user/info", // 小程序的页面路径
            hdImageData: "http://wwww.xxx.com/xx.jpg", // 程序新版本的预览图二进制数据 不超过128kb 支持 地址 base64 temp
            withShareTicket: true, // 是否使用带shareTicket的分享
            miniprogramType: Wechat.Mini.RELEASE 
        }
    },
    scene: Wechat.Scene.SESSION   // 小程序仅支持聊天界面
}, function () {
    alert("Success");
}, function (reason) {
    alert("Failed: " + reason);
});

Send payment request

// See https://github.com/xu-li/cordova-plugin-wechat-example/blob/master/server/payment_demo.php for php demo
var params = {
    partnerid: '10000100', // merchant id
    prepayid: 'wx201411101639507cbf6ffd8b0779950874', // prepay id
    noncestr: '1add1a30ac87aa2db72f57a2375d8fec', // nonce
    timestamp: '1439531364', // timestamp
    sign: '0CB01533B8C1EF103065174F50BCA001', // signed string
};

Wechat.sendPaymentRequest(params, function () {
    alert("Success");
}, function (reason) {
    alert("Failed: " + reason);
});

Choose invoices from card list

//offical doc https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1496561749_f7T6D
var params = {
    timeStamp: '1510198391', // timeStamp
    signType: 'SHA1', // sign type
    cardSign: 'dff450eeeed08120159d285e79737173aec3df94', // cardSign
    nonceStr: '5598190f-5fb3-4bff-8314-fd189ab4e4b8', // nonce
};

Wechat.chooseInvoiceFromWX(params,function(data){
    console.log(data);
},function(){
    alert('error');
})

open wechat mini program

//offical doc https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=21526646437Y6nEC&token=&lang=zh_CN
var params = {
    userName: 'gh_d43f693ca31f', // userName
    path: 'pages/index/index?name1=key1&name2=key2', // open mini program page
    miniprogramType: Wechat.Mini.RELEASE // Developer version, trial version, and official version are available for selection
};

Wechat.openMiniProgram(params,function(data){
    console.log(data); // data:{extMsg:""}  extMsg: Corresponds to the app-parameter attribute in the Mini Program component <button open-type="launchApp">
},function(){
    alert('error');
})

more usage please see https://jasonz1987.github.io/cordova-wechat-docs/docs/usages

Join us

QQ群:190808518 cordova-wechat官方交流群

Donate

we need your support to improve open source software ,if we induce your develop time ,welcome to donate us.

paypal

donate.png

LICENSE

MIT LICENSE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].