移植 msext QQShareManager.m:716-771 simpleShareToQQFriend 简化版到 Swift。
QQShare.share 完整实现:
- canOpenURL("mqqapi://") 检测 QQ 安装;未装返回 .notInstalled
- 仅链接分享走完整 URL Scheme(type == "1");type == "2"/其它(截图 /
远端图)暂返回 .success 避免 H5 业务卡住,Phase 4.F 接入
- URL 构造(与 msext 等价):
* scene == .timeline → mqqapi://share/to_qzone? (QQ 空间)
* scene == .friend → mqqapi://share/to_fri? (QQ 好友)
* 参数:version=1 + cflag=0 + req_type=1(无 url 时 req_type=0)+
url=<encoded> + title=<encoded> + description=<encoded>
- encode 函数与 msext QQShareManager.m:1262-1268 等价:仅保留 RFC 3986
unreserved 字符(alphanumeric + "-._~"),其它全部 percent encode
- canOpenURL 二次检查 + await UIApplication.open
- 调起即视为 success(msext 同款乐观策略,URL Scheme 单向无返回)
Info.plist 新增 LSApplicationQueriesSchemes(iOS 9+ canOpenURL 白名单
要求,否则总返回 false):
- mqq / mqqapi / mqqopensdkfriend / mqqopensdkapiV2/V3/V4(QQ 相关)
- snssdk1128(抖音,Phase 4.D 用)
- 微信相关待 Phase 4.E 接入 SDK 时再加(weixin / weixinULAPI 等)
BuildProject 通过
Plan §5 Phase 4.3 勾选
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
69 lines
2.7 KiB
Plaintext
69 lines
2.7 KiB
Plaintext
<?xml version="1.0" encoding="UTF-8"?>
|
||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||
<plist version="1.0">
|
||
<dict>
|
||
<key>UIApplicationSceneManifest</key>
|
||
<dict>
|
||
<key>UIApplicationSupportsMultipleScenes</key>
|
||
<false/>
|
||
<key>UISceneConfigurations</key>
|
||
<dict>
|
||
<key>UIWindowSceneSessionRoleApplication</key>
|
||
<array>
|
||
<dict>
|
||
<key>UISceneConfigurationName</key>
|
||
<string>Default Configuration</string>
|
||
<key>UISceneDelegateClassName</key>
|
||
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
|
||
</dict>
|
||
</array>
|
||
</dict>
|
||
</dict>
|
||
<key>NSAppTransportSecurity</key>
|
||
<dict>
|
||
<!-- 企业签 / 超签分发场景,后端域名可能调整(zip CDN / 配置服 / 七牛 / 错误日志
|
||
上报等),白名单维护成本高于安全收益。决策:全局放行,由代码层面通过 HTTPS
|
||
优先 + URLSession session 校验保证非白名单的第三方 SDK 流量自身仍走加密通道。
|
||
详见 ADR-008 / CLAUDE.md「不上架 App Store,通过企业签 / 超签 / TF 分发」。 -->
|
||
<key>NSAllowsArbitraryLoads</key>
|
||
<true/>
|
||
</dict>
|
||
<key>UIRequiresFullScreen</key>
|
||
<true/>
|
||
<key>UIStatusBarHidden</key>
|
||
<false/>
|
||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||
<true/>
|
||
<!--
|
||
LaunchScreen 阶段(iOS 在 app 进程尚未启动、device idiom 尚未识别的早期窗口)
|
||
只看顶层 UISupportedInterfaceOrientations,不识别 ~iphone / ~ipad 后缀变体。
|
||
Xcode 26 的 General → Deployment Info UI 只会写 INFOPLIST_KEY_*_iPhone /
|
||
INFOPLIST_KEY_*_iPad 两条带后缀的 key,会导致 LaunchScreen 默认 portrait 渲染、
|
||
再被旋转 90° 适配横屏设备(视觉:splash 内容横躺)。在 Info.plist 里显式补一份
|
||
无后缀 key 修复 LaunchScreen orientation。
|
||
-->
|
||
<key>UISupportedInterfaceOrientations</key>
|
||
<array>
|
||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||
</array>
|
||
<!--
|
||
LSApplicationQueriesSchemes — canOpenURL 白名单(iOS 9+ 必须声明,否则
|
||
canOpenURL 总返回 false)。本项目分享接入:
|
||
- QQ(URL Scheme 路径,不依赖 SDK):mqq / mqqapi / mqqopensdkfriend 等
|
||
- 抖音(URL Scheme + Photos 路径,不依赖 SDK):snssdk1128
|
||
- 微信(Phase 4.E SDK 接入时再加 weixin / weixinULAPI / weixinURLParamsAPI)
|
||
-->
|
||
<key>LSApplicationQueriesSchemes</key>
|
||
<array>
|
||
<string>mqq</string>
|
||
<string>mqqapi</string>
|
||
<string>mqqopensdkfriend</string>
|
||
<string>mqqopensdkapiV2</string>
|
||
<string>mqqopensdkapiV3</string>
|
||
<string>mqqopensdkapiV4</string>
|
||
<string>snssdk1128</string>
|
||
</array>
|
||
</dict>
|
||
</plist>
|