reactnativecn / react-native-wx Goto Github PK
View Code? Open in Web Editor NEW微信模块
微信模块
WechatAPI.login(config) 返回的 {
"code": "",
"appid": "",
"lang": "",
"country": "",
} 后, 我自己是不是 还得 写一个 网络请求 以下链接获取access_token:
https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code
您好,请问:
DuangLink-MacBook-Pro:bizapp3.test duanglink$ react-native -v
react-native-cli: 1.0.0
react-native: 0.35.0
DuangLink-MacBook-Pro:bizapp3.test duanglink$ npm install react-native-wx --save
[email protected] /Users/duanglink/ReactNativeProjects/bizapp3.test
├── UNMET PEER DEPENDENCY [email protected]
└─┬ [email protected]
└─┬ [email protected]
└── [email protected]
npm WARN [email protected] requires a peer of react-native@^0.33.0 but none was installed.
应该如何解决?谢谢。
编译通过,login()
方法能呼起微信客户端,但在微信客户端点击授权完成后,回到我的客户端后,login()
方法返回的 promise.then()
或 catch()
都没有继续执行,无法获取结果,也一直没有报错。
执行 isWXAppSupportApi()
能返回 true
。
已确保微信 app id 正确可用,客户端 bundle id 也已经填写正确。
我的环境是:
react-native: v0.42
react-native-wx: v3.0.3
xCode: v8.2.1
macOS: v10.12
微信:v6.5.5
十分感谢 😂
android分享成功后好像是没有回调的
mylocalpath/node_modules/react-native-wx/ios/RCTWeChatAPI/RCTWeChatAPI.m:208:30: error: no visible @interface for 'RCTImageLoader' declares the selector
'loadImageWithURLRequest:size:scale:clipped:resizeMode:progressBlock:completionBlock:'
[_bridge.imageLoader loadImageWithURLRequest:imageUrl size:size scale:1 clipped:true resizeMode:UIViewContentModeScaleToFill progressBlock:nil completionBlock:^(NSError *err...
~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mylocalpath/node_modules/react-native-wx/ios/RCTWeChatAPI/RCTWeChatAPI.m:299:34: warning: 'sendAppEventWithName:body:' is deprecated: Subclass RCTEventEmitter
instead [-Wdeprecated-declarations]
[self.bridge.eventDispatcher sendAppEventWithName:@"WeChat_Resp" body:body];
^
In file included frommylocalpath/node_modules/react-native-wx/ios/RCTWeChatAPI/RCTWeChatAPI.m:14:
../../react-native/React/Base/RCTEventDispatcher.h:64:1: note: 'sendAppEventWithName:body:' has been explicitly marked deprecated here
支付功能没有调试成功, 希望提供一下example
这是微信的吧,为什么README里分享用的是WeiboAPI,写错了吧,
ios 配置里liz.tbd包应该是 libz.tbd吧
Rn版本0.28
我试过:
WechatAPI.login({
scope: 'snsapi_base', // 默认 'snsapi_userinfo'
})
这样不行,报“Scope参数错误或没有 Scope权限”。 是不是我调用错了?
分享后有回调么,传入callback,或者返回promise之类的?我看现在分享返回后否没有触发
这么久没更新了 还能用吗
微信插件打包提示Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]}。。。之类的,生成的apk闪退,请问怎么解决
Manifest merger failed : Attribute meta-data#WX_APPID@value at AndroidManifest.xml:18:9-20:43 requires a placeholder substitution but no value for <WX_APPID> is provided.
run-android 报这个错
配置以后 出现WeChat API invoke returns false时什么情况呢
rn版本0.30 , android 支付闪退,android测试版本5.1 ,6.0 。登录没有问题。
IOS没有任何问题!
大佬有没有vx防撤回模块呀
undefined is not a function (evaluating 'globalObject.hasOwnProperty("Promise")')
index.android.bundle?platform=android&dev=true&hot=false&minify=false:58519:41
index.android.bundle?platform=android&dev=true&hot=false&minify=false:58546:6
index.android.bundle?platform=android&dev=true&hot=false&minify=false:58553:2
loadModuleImplementation
index.android.bundle?platform=android&dev=true&hot=false&minify=false:109:12
guardedLoadModule
index.android.bundle?platform=android&dev=true&hot=false&minify=false:70:36
_require
index.android.bundle?platform=android&dev=true&hot=false&minify=false:54:77
index.android.bundle?platform=android&dev=true&hot=false&minify=false:58438:29
index.android.bundle?platform=android&dev=true&hot=false&minify=false:58494:2
loadModuleImplementation
index.android.bundle?platform=android&dev=true&hot=false&minify=false:109:12
guardedLoadModule
index.android.bundle?platform=android&dev=true&hot=false&minify=false:70:36
_require
index.android.bundle?platform=android&dev=true&hot=false&minify=false:54:77
index.android.bundle?platform=android&dev=true&hot=false&minify=false:58273:28
loadModuleImplementation
index.android.bundle?platform=android&dev=true&hot=false&minify=false:109:12
guardedLoadModule
index.android.bundle?platform=android&dev=true&hot=false&minify=false:70:36
_require
index.android.bundle?platform=android&dev=true&hot=false&minify=false:54:77
index.android.bundle?platform=android&dev=true&hot=false&minify=false:57658:29
loadModuleImplementation
index.android.bundle?platform=android&dev=true&hot=false&minify=false:109:12
guardedLoadModule
index.android.bundle?platform=android&dev=true&hot=false&minify=false:70:36
_require
index.android.bundle?platform=android&dev=true&hot=false&minify=false:54:77
index.android.bundle?platform=android&dev=true&hot=false&minify=false:50158:21
loadModuleImplementation
index.android.bundle?platform=android&dev=true&hot=false&minify=false:109:12
guardedLoadModule
index.android.bundle?platform=android&dev=true&hot=false&minify=false:70:36
_require
index.android.bundle?platform=android&dev=true&hot=false&minify=false:54:77
index.android.bundle?platform=android&dev=true&hot=false&minify=false:50060:20
loadModuleImplementation
index.android.bundle?platform=android&dev=true&hot=false&minify=false:109:12
guardedLoadModule
index.android.bundle?platform=android&dev=true&hot=false&minify=false:70:36
_require
index.android.bundle?platform=android&dev=true&hot=false&minify=false:54:77
index.android.bundle?platform=android&dev=true&hot=false&minify=false:1241:23
loadModuleImplementation
index.android.bundle?platform=android&dev=true&hot=false&minify=false:109:12
guardedLoadModule
index.android.bundle?platform=android&dev=true&hot=false&minify=false:63:45
_require
index.android.bundle?platform=android&dev=true&hot=false&minify=false:54:77
global code
index.android.bundle?platform=android&dev=true&hot=false&minify=false:74953:9
自动link返回成功后。
发现下面的步骤还是手动要做,否则报错。
android/app/src/main/java/<你的包名>/MainApplication.java中,public class MainApplication 之前增加:
import cn.reactnative.modules.wx.WeChatPackage;
如果react-native版本 >=0.18.0 在new MainReactPackage()之后增加
,new WeChatPackage()
ios端图片分享报错Wechat API invoke returns false.
"react-native": "0.35.0",
"react": "^15.3.1",
react-native run-android时输出:
that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.tencent.mm.sdk.openapi.WXApiImplV10$ActivityLifecycleCb$2) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.tencent.mm.sdk.b.b) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
使用WechatAPI.shareToSession(data)方法可以成功调起微信,但在选择好友步骤点击好友头像无反应
登录与分享都没有问题,APP端支付拿data : {
partnerId: "",
prepayId: "",
nonceStr: "",
timeStamp: "",
package: "",
sign: "",
}这些参数去请求,android无法调起微信返回Error,ios调起微信只有一个确定按钮,点击之后返回error:用户点击了取消
支付系统测试过没,可行么
微信没登录会跳转到微信登录界面,登录之后跳转回应用,再次点击微信登录没反应
No visible @interface for 'RCTImageLoader' declares the selector 'loadImageWithTag:size:scale:resizeMode:progressBlock:completionBlock:'
QQ 、WX第一次登录授权返回没回调,什么原因????
您好,在微信登录页面不填写账号密码,点击返回后提示:很抱歉,“应用”停止运行,然后点击确定后会重新打开app。可能的原因是什么呢?烦请帮忙分析一下。非常感谢呢。
logcat报 image no null
const data = {
type: 'news',
title: articleTitle,
description: 'describe',
webpageUrl: url,
imageUrl: 'http://img4.imgtn.bdimg.com/it/u=356358824,983689058&fm=200&gp=0.jpg',
};
补充说明:Android 手机分享给 iOS 手机,分享代码如下:
await WechatAPI.shareToSession({
type: 'image',
//imageUrl: 'http://www.ncloud.hk/email-signature-262x100.png'
imageUrl: 'http://img.tougudashi.com/share/1463218403.3611000.png'
});
@sunnylqm @lvbingru @lqs6910 @tdzl2003 @cham1985 请帮忙看看,不好意思,打扰到这么多人,谢谢!
Error:Execution failed for task ':react-native-wx:processDebugAndroidTestManifest'.
Manifest merger failed : Attribute meta-data#WX_APPID@value at manifestMerger7048962468923408949.xml requires a placeholder substitution but no value for <WX_APPID> is provided. 无法打包
在分享api的参数中设置imageurl为"xx.png"并将图片放置于drawable文件夹内,shareToSession会读取工程目录下的图片,然而shareToTimeline不会。
var data = {
imageUrl: 'ic_launcher.png',
...
}
在ios下面没有问题。但是安卓下,微信授权界面打开后,点击授权,没有返回数据。分享功能中,发送给朋友文字信息,能打开微信的界面,但是点击朋友后,发送界面一闪而过,不能发出去。请问是什么原因?
android上是这个问题
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.