Unity IOS SDK 集成 打开第三方应用
2019-07-11 本文已影响0人
xzhuan
xzhuan原创稿件,转载请注明出处!
需求打开IOS设备上 其它应用
1.使用支付宝 示列
NSURL *url = [NSURL URLWithString:@"alipay://"];
判断是否能打开该应用(返回bool值) [[UIApplication sharedApplication] canOpenURL:url]
打开对应应用 [[UIApplication sharedApplication] openURL:url];
2.跳转到本地或第三方应用的一些URL Schemes
苹果自带应用URL Schemes:
@{"APP":@"打电话",@"Schemes":@"tel"},
@{@"APP":@"发短信",@"Schemes":@"sms"},
@{@"APP":@"打开日历",@"Schemes":@"calshow"},
@{@"APP":@"提醒",@"Schemes":@"x-apple-reminder"},
@{@"APP":@"邮件",@"Schemes":@"message"},
@{@"APP":@"iTunes Store",@"Schemes":@"itms"},
@{@"APP":@"App Store",@"Schemes":@"itms-apps"},
@{@"APP":@"iBooks",@"Schemes":@"ibooks"},
@{@"APP":@"Facetime",@"Schemes":@"facetime"}
一些常见的第三方应用URL Schemes:
<key>LSApplicationQueriesSchemes</key>
<array>
<!-- 微信 URL Scheme 白名单-->
<string>wechat</string>
<string>weixin</string>
<!-- 新浪微博 URL Scheme 白名单-->
<string>sinaweibohd</string>
<string>sinaweibo</string>
<string>sinaweibosso</string>
<string>weibosdk</string>
<string>weibosdk2.5</string>
<!-- QQ、Qzone URL Scheme 白名单-->
<string>mqqapi</string>
<string>mqq</string>
<string>mqqOpensdkSSoLogin</string>
<string>mqqconnect</string>
<string>mqqopensdkdataline</string>
<string>mqqopensdkgrouptribeshare</string>
<string>mqqopensdkfriend</string>
<string>mqqopensdkapi</string>
<string>mqqopensdkapiV2</string>
<string>mqqopensdkapiV3</string>
<string>mqzoneopensdk</string>
<string>wtloginmqq</string>
<string>wtloginmqq2</string>
<string>mqqwpa</string>
<string>mqzone</string>
<string>mqzonev2</string>
<string>mqzoneshare</string>
<string>wtloginqzone</string>
<string>mqzonewx</string>
<string>mqzoneopensdkapiV2</string>
<string>mqzoneopensdkapi19</string>
<string>mqzoneopensdkapi</string>
<string>mqzoneopensdk</string>
<!-- 支付宝 URL Scheme 白名单-->
<string>alipay</string>
<string>alipayshare</string>
</array>
3.添加白名单列表
哇咔咔~~~