iOS9適配 之 關於info.plist 第三方登陸 添加URL Schemes白名單

近期蘋果公司iOS 9系統策略更新,限制了http協議的訪問,此外應用須要在「Info.plist」中將要使用的URL Schemes列爲白名單,纔可正常檢查其餘應用是否安裝。ios

受此影響,當你的應用在iOS 9中須要使用 QQ/QQ空間/支付寶/微信SDK 的相關能力(分享、收藏、支付、登陸等)時,須要在「Info.plist」裏增長以下代碼:chrome

 

<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>




其餘平臺可在下面的列表中查詢: 各平臺OpenURL白名單說明api

平臺名稱 URL Schem 補充說明
微信 wechat,

 

weixin
 
支付寶 alipay,

 

alipayshare
 
QQ mqqOpensdkSSoLogin,

 

mqqopensdkapiV2,

 

mqqopensdkapiV3,

 

wtloginmqq2,

 

mqq,

 

mqqapi
 
QZONE mqzoneopensdk,

 

mqzoneopensdkapi,

 

mqzoneopensdkapi19,

 

mqzoneopensdkapiV2,

 

mqqOpensdkSSoLogin,

 

mqqopensdkapiV2,

 

mqqopensdkapiV3,

 

wtloginmqq2,

 

mqqapi,

 

mqqwpa,

 

mqzone,

 

mqq
[注:若同時使用QQ和QZONE,則直接添加本格便可]
新浪微博 sinaweibo,

 

sinaweibohd,

 

sinaweibosso,

 

sinaweibohdsso,

 

weibosdk,

 

weibosdk2.5
[後兩個若導入新浪SDK則須要]
豆瓣 無需配置  
開心網 無需配置  
易信 yixin,

 

yixinopenapi
 
Google+ googlechrome,

 

googlechrome-x-callback,

 

hasgplus4,

 

com.google.gppconsent,

 

com.google.gppconsent.2.2.0,

 

com.google.gppconsent.2.3.0,

 

com.google.gppconsent.2.4.0,

 

com.google.gppconsent.2.4.1
 
人人網 renrenapi,

 

renrenios,

 

renreniphone,

 

renren,
 
Facebook fbauth2  
Twitter 無需配置  
Pocket pocket-oauth-v1  
Pinterest pinit  
Instagram instagram  
WhatsApp whatsapp  
Line line  
KakaoTalk kakaolink  
KaokaoStory storylink  
LinkedIn 無需配置  
Tumblr 無需配置  
非平臺類 無需配置 ( 如短信,複製,郵件等)


========================== 說法二 ========================

近期蘋果公司iOS 9系統策略更新,限制了http協議的訪問,此外應用須要在「Info.plist」中將要使用的URL Schemes列爲白名單,纔可正常檢查其餘應用是否安裝。微信

受此影響,當你的應用在iOS 9中須要使用 QQ/QQ空間/支付寶/微信SDK 的相關能力(分享、收藏、支付、登陸等)時,須要在「Info.plist」裏增長以下代碼:app

<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>
相關文章
相關標籤/搜索