欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

修改HTTPS 添加白名单

程序员文章站 2022-05-19 08:18:12
...

格式

  <key>key的名称</key>
	<array>
	多个字符串数组
   </array>

输入白名单:
复制一下代码到info.plist文件里

	<key>LSApplicationQueriesSchemes</key>
		<array>
		
            <!-- 新浪微博 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>

			    <!-- 微信 URL Scheme 白名单-->
            <string>wechat</string>
            <string>weixin</string>
            
        </array>

如果在iOS9 中直接进行HTTP请求,需要在info.list中添加如下代码

<key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>

参考:
http://wiki.mob.com/适配ios-9+系统/