WXApi.registerApp 不返回,也不报错,是什么原因?
发布于 6 年前 作者 laimin 6978 次浏览 来自 官方Issues

环境:xcode10.1

podfile相关设置

pod ‘mob_sharesdk’, ‘~> 4.2.2’

pod ‘mob_sharesdk/ShareSDKPlatforms/QQ’, ‘~> 4.2.2’

pod ‘mob_sharesdk/ShareSDKPlatforms/WeChatFull’, ‘~> 4.2.2’

pod ‘mob_sharesdk/ShareSDKPlatforms/Copy’, ‘~> 4.2.2’

该api出现在shareSDK这个库下面,pod install的时候shareSDK发生了更新,其他三方库没有更新,更新结果如下

Using MJRefresh (3.1.15.7)

Installing MOBFoundation 3.2.6 (was 3.2.1)

Using SDWebImage (4.4.2)

Using SnapKit (4.2.0)

Using YYText (1.0.7)

Installing mob_sharesdk 4.2.9.1 (was 4.2.2)

更新之前该api是有返回的,所以后面的代码能执行,更新之后,api不报错,也没返回,导致程序一直停在该api调用的地方

相关代码:

     initRootViewController()

     SocketManagerNew.share.connectToSocket()

      print(“before WXApi.registerApp”)

     // 微信支付注册

     WXApi.registerApp(“xxxxxxxxxxx”) //这里就不方便显示ID了,用xxxx代替

      print(“after WXApi.registerApp”)

     // 设置图片加载类型

     SDWebImageManager.shared().imageDownloader?.setValue(nil, forHTTPHeaderField: “Accept”)

执行结果:

控制台打印

2020-01-08 13:55:37.714547+0800 SmartInvest[89111:6760012] socket connect: xxxx.xxxx.xxxx.xxxx, xxxxx

2020-01-08 13:55:37.739276+0800 SmartInvest[89111:6760012] socket connect: xxxx.xxxx.xxxx.xxxx, xxxxx

2020-01-08 13:55:37.739600+0800 SmartInvest[89111:6760012] socket connect: xxxx.xxxx.xxxx.xxxx, xxxxx

before WXApi.registerApp

只打印了__before WXApi.registerApp__后面就没有打印了

找了shareSDK的技术支持,他们说shareSDK已经更新到4.3.4,建议我更新,并说这个api是微信官方这边的api,所以才在这里提问。

另外我更新shareSDK之前,WXApi.registerApp 是有返回的。看现象是由于这次pod install导致的这个问题,我想确认下是不是就是这个原因,还有就是如何解决这个问题

1 回复

你好,请移步至微信支付专区提问,我们会有对应同学来处理。https://developers.weixin.qq.com/community/pay

回到顶部