Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QQ 分享没有收到回调,会不会是因为。。。 #162

Closed
lijingcheng opened this issue Sep 23, 2019 · 7 comments
Closed

QQ 分享没有收到回调,会不会是因为。。。 #162

lijingcheng opened this issue Sep 23, 2019 · 7 comments

Comments

@lijingcheng
Copy link

lijingcheng commented Sep 23, 2019

QQ 成功分享并返回到 app 中,MonkeyKing.handleOpenURL 方法中 urlScheme 为 "tencent...",并没有进入到下面代码中
// QQ Share
if urlScheme.hasPrefix("QQ") { ... }

而是进入了
// QQ OAuth
if urlScheme.hasPrefix("tencent") { ... }
并且发生了 OAuth Error 所以 return false 并且没有回调 deliverCompletionHandler

分享的回调 url
tencentxxxxxxx://response_from_qq?source=qq&source_scheme=mqqapi&error=0&version=1&sdkv=3.3.5_lite
OAuth的回调url
tencentxxxxxxx://qzapp/mqzone/0?generalpastboard=1

@nixzhu
Copy link
Owner

nixzhu commented Sep 23, 2019

@lijingcheng 很棒的分析,你可考虑发个PR来修正这个问题(保持兼容性)

@lijingcheng
Copy link
Author

lijingcheng commented Sep 24, 2019

@nixzhu 如果 urlScheme.hasPrefix("QQ") 这个判断以前是好使的话,那应该是 QQ平台更新了规则,对于 OAuth 和 Share 的 api 地址以及所需参数字段名称这些数据,你是通过抓包的方式获取的吗?我看微博有较详细的 api 说明,微信的没找到,QQ的找到一部分

最近微信和QQ的 sdk 都在加对 Universal Links 的校验,QQ也说了不更新的话到今年 12 月 1 日时分享功能就会返回失败。。。

@nixzhu
Copy link
Owner

nixzhu commented Sep 24, 2019

之前这部分应该是 @Limon-O-O 写的,当时 OK,不需要抓包,open url 里就能确定。如果新版的 QQ 都是这个 prefix,可考虑全部改,只需测试分享和 OAuth 都 OK 即可。

@Limon-O-O
Copy link
Collaborator

当时直接在回调到应用时拿到的 open url 确定的前缀,不好意思,最近实在是忙...我这几天抽时间看看...

@Limon-O-O
Copy link
Collaborator

Limon-O-O commented Sep 27, 2019

@lijingcheng 请问你是用什么版本的 QQ,App Store 新版 QQ 在本工程的 demo 分享到好友、QQ 空间没有复现此问题,urlScheme 前缀为 tencent 只有在 OAuth 时,并无出现在分享时

@lijingcheng
Copy link
Author

@Limon-O-O QQ 版本是 8.1.3.411,当时试的是分享到好友功能

@xspyhack
Copy link
Collaborator

QQ 8.1.5 版本(不是国际版/TIM)分享依然是 URL Scheme 依然是 QQ 前缀,没有看到 tencent 前缀。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants