vilicvane / cordova-plugin-wechat Goto Github PK
View Code? Open in Web Editor NEWCordova 微信分享插件
Cordova 微信分享插件
第一个 : 配置这块,应该不是 config.xml 文件吧,应该是 AndroidManifest.xml吧
第二个 : ant.properties 这个里面的路径治怎么配置?求个大概的demo看一下,我配置的cordova run android --release 后一直是unsign的包 ,我是这样写的,key.store=C:\Users\guoqq\Desktop\demo\weixinticket.keystore,应该是没取到里面的东西。然后我用eclipse 下 Android-tools输出包是带sign的
情况一(微信已经安装并且有登陆账户信息):
IOS调用接口分享到微信朋友圈-->在微信分享界面点击取消-->返回app直接进入成功回调函数(预期应该进入失败回调函数)
情况二(微信已安装,没有用户登陆信息):
IOS调用接口分享到微信朋友圈-->打开微信到微信登陆界面-->不进行登陆,手动返回app-->进入成功回调函数(预期应该进入失败回调函数)
请问,这个问题需要解决么?
你有这个问题么?我在小米3上测试的,用的ionic
@vilic 您好,
该插件的使用过程中,严格按照说明步骤,签名、appId均设置正常。Wechat.isInstalled方法调用也正常,但是微信登录接口(Wechat.auth)很多时候无法唤起微信进行授权:
var scope = "snsapi_userinfo";
Wechat.auth(scope, function (response) {
// 没有进入这里
}, function (error) {
// 返回的error是 'ERR_AUTH_DENIED'
});
通过5部android手机测试,发现结果如下:
不知道您有没有遇到类似的问题?谢谢!
张晓庆
如题
在cordova build android
过程中遇到这个问题,请问是哪里配置问题吗:
...
platforms/android/src/com/wordsbaking/cordova/wechat/WeChat.java:17: 错误: 找不到符号
import com.tencent.mm.sdk.openapi.SendMessageToWX;
...
在import com.tencent.mm.sdk.openapi
这一级
分享链接的时候,怎么设置默认的分享文字啊?就向分享文本那样。
description没用,设置在description里的内容没有见哪里显示啊!
title是显示在链接图旁边的介绍文字。
Ionic + AngularJS + Cordova
PS D:\workspace\ionic\WechatApp> cordova platform add android
npm http GET https://registry.npmjs.org/cordova-android/3.6.4
npm http 304 https://registry.npmjs.org/cordova-android/3.6.4
Creating android project...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: com.ionicframework.wechatapp720428
Name: WechatApp
Android target: android-19
Copying template files...
Project successfully created.
Running command: "C:\Program Files\nodejs\node.exe" D:\workspace\ionic\WechatApp\hooks\after_prepare\010_add_platform_cl
ass.js D:\workspace\ionic\WechatApp
add to body class: platform-android
Installing "com.ionic.keyboard" for android
Installing "com.wordsbaking.cordova.wechat" for android
Failed to install 'com.wordsbaking.cordova.wechat':Error: Variable(s) missing: APP_ID
at C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:304:23
at _fulfilled (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:787:54)
at self.promiseDispatch.done (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:816:30)
at Promise.promise.promiseDispatch (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:749
:13)
at C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:557:44
at flush (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:419:13)
Error: Variable(s) missing: APP_ID
at C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:304:23
at _fulfilled (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:787:54)
at self.promiseDispatch.done (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:816:30)
at Promise.promise.promiseDispatch (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:749
:13)
at C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:557:44
at flush (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:419:13)
目前我的app还在开发初期,正在添加登陆功能,请问如何可以获取微信appID?
我试过在微信开放平台上创建新的移动应用,但是貌似需要填写我的app在app store和google play的链接。但是我的app还没开发完成啊!
微信开放平台没有沙盒么?开发阶段应该在哪里获取appID呢?
https://github.com/gitawego/cordova-screenshot
找到这个插件, 但是没有找到配合一起使用的方法
如题,现在cordova插件基本都是放到npm上了, 比如: https://github.com/apache/cordova-plugin-device/blob/master/package.json
谢谢呢~
fengfangqiandeMacBook-Pro:xqb-app fengfangqian$ cordova plugin add com.wordsbaking.cordova.wechat --variable APP_ID=wxb72feca57491164c
Fetching plugin "com.wordsbaking.cordova.wechat" via plugin registry
npm http GET http://registry.cordova.io/com.wordsbaking.cordova.wechat
npm http 304 http://registry.cordova.io/com.wordsbaking.cordova.wechat
npm http GET http://cordova.iriscouch.com/registry/_design/app/_rewrite/com.wordsbaking.cordova.wechat/-/com.wordsbaking.cordova.wechat-0.3.0.tgz
npm http 200 http://cordova.iriscouch.com/registry/_design/app/_rewrite/com.wordsbaking.cordova.wechat/-/com.wordsbaking.cordova.wechat-0.3.0.tgz
Installing "com.wordsbaking.cordova.wechat" for android
Error during processing of action! Attempting to revert...
Failed to install 'com.wordsbaking.cordova.wechat':Error: Uh oh!
"/Users/fengfangqian/www/xiaoqianbao/client/trunk/xqb-app/platforms/android/libs/libammsdk.jar" already exists!
at Object.module.exports.common.copyNewFile (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/common.js:67:19)
at module.exports.source-file.install (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/android.js:78:20)
at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:67:25)
at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:575:20)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:335:28
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:509:49
at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
Error: Uh oh!
"/Users/fengfangqian/www/xiaoqianbao/client/trunk/xqb-app/platforms/android/libs/libammsdk.jar" already exists!
at Object.module.exports.common.copyNewFile (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/common.js:67:19)
at module.exports.source-file.install (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/android.js:78:20)
at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:67:25)
at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:575:20)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:335:28
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:509:49
at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
你好,在做图片分享时候,出现图片未传过去。签名什么都对,链接也可以。
一定需要www这个目录下的吗?我用的intel xdk开发的。没有www这个目录,图标读取不到
handleOpenURL通知是哪儿注册的呢,又是哪儿发起的?
你好!以下是测试调用代码,程序不报任何错误,但是就是没有分享出去,所使用AppID已经在微信开发者平台获取'分享到朋友圈'和'发送给朋友'的权限,最为奇怪的是console也看不到任何成功或者失败的日志,调用函数没有任何效果,这是怎么回事?
onDeviceReady: function() {
app.receivedEvent('deviceready');
WeChat.share('李克强:让农民工生活有希望', WeChat.Scene.session, function () {
console.log('分享成功~');
}, function (reason) {
console.log(reason);
});
WeChat.share({
title: '李克强:让农民工生活有希望奋斗有回报',
description: '据**政府网4日至6日,国务院总理李克强在广东省委书记胡春华,省长朱小丹陪同下,在深圳、广州考察。',
url: 'http://world.haiwainet.cn/n/2015/0107/c232591-21605009.html'
}, WeChat.Scene.timeline, function () {
console.log('分享成功~');
}, function (reason) {
// 分享失败
console.log(reason);
});
console.log('Invoke Finish');
}
以下是日志:
--------- beginning of /dev/log/system
I/CordovaLog(30158): Changing log level to DEBUG(3)
D/CordovaLog(30158): file:///android_asset/www/index.html: Line 26 : Viewport ta
rget-densitydpi is not supported.
D/CordovaLog(30158): file:///android_asset/www/js/index.js: Line 63 : Received E
vent: deviceready
D/CordovaLog(30158): file:///android_asset/www/js/index.js: Line 52 : Invoke Fin
ish....
在scripts目录下有android-install.js,wp-install.js,为什么没有ios-install.js?
兄弟可以增加远程图片作为缩略图吗?
参考xu-li/cordova-plugin-wechat#45
android,应用签名和包名都保持和微信开放平台申请的一致,可是点击为什么没有丝毫反应,也没有报错。
WeChat.share({
type: WeChat.ShareType.webpage,
title: ' 这是标题',
thumbData:'这是我图片的base64编码字符串,前面加不加data:image/png;base64,都不行 ',
url: 'http://www.xxxxxx.com'
}, shareType, function () {
//分享成功
}, function (reason) {
// 分享失败
});
文件WXEntryActivity.java 第一行的 package to.be.replaced.wxapi; 是否是要替换成 config.xml 里的 widget id ?
你好,我又来麻烦你了....
关于微信分享的缩略图
我的代码是这样的。但是没有抓取到缩略图,请问这个缩略图在哪配置呢?需要传什么参数,还是微信自己抓的??劳烦了。。。
function firendShare(){
WeChat.isInstalled(function(){
WeChat.share({
type: WeChat.ShareType.webpage,
title: $scope.shareTitle,
description: $scope.shareInfo,
url: weixinShareUrl,
}, WeChat.Scene.session, function(){
$rootScope.$broadcast('yt.shareAfter');
}, function (reason) {
// 分享失败
$rootScope.$broadcast('yt.shareAfter');
});
},function(err){
alert('您的手机需要安装微信.');
$rootScope.$broadcast('yt.shareAfter');
})
微信里图片发送一直在%2或3%,朋友的微信里能收到但无内容...
但我分享到朋友圈(WeChat.Scene.timeline)使用同样的代码却没有问题,求大侠指点
测试环境手机lgg3, 安卓 5.0.1, usb连接电脑,使用的wifi, pc与手机同一个网段 ,微信6.3.8
说明:发送给朋友的图片是我截图生成的base64字符串,去掉了头部的那些说明字符
WeChat
.share({
type: WeChat.ShareType.image,
data: imgdata // 这个是去掉头部只剩字节内容的base64
}, WeChat.Scene.session, function () {
alert.log('分享成功~');
}, function (reason) {
// 分享失败
alert.log(reason);
});
这个插件能支持登录吗?
你好,今天试了一下这个插件,Share text没问题,但使用Share media的时候,报了
”JSON error“,请问是什么问题?
盼复,感谢。
百度了一下没有找到, 文档里也没这个出错的状态,有时间帮忙看看谢谢了。
这个插件安装后 会缺少api 请检测。图片分享也有问题
我设置type是image,然后进入分享界面时候,点击联系人会闪一下,不能分享出去
WeChat
.share({
type: WeChat.ShareType.image,
url:'http://xxxtg.png',
title: 'aa',
description: 'bb'
}, WeChat.Scene.session, function () {
console.log('分享成功~');
}, function (reason) {
// 分享失败
console.log(reason);
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.