iOS自定义链接

2017-04-10  本文已影响153人  我是小胡胡分胡

URL types CFBundleURLTypes
URL identifier CFBundleURLName
URL Schemes CFBundleURLSchemes

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLName</key>
        <string>com.schemedemo1</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>urlschemedemo1</string>
        </array>
    </dict>
</array>



<key>LSApplicationQueriesSchemes</key>
<array>
<string>urlschemedemo3</string>
</array>


openURL:
iOS[2.0,10.0)可用

canOpenURL:
iOS 3.0以上可用
LSApplicationQueriesSchemes
必须将被检测的app的urlschemes添加到LSApplicationQueriesSchemes键值数组内。否则canOpenURL一直返回NO

openURL:options:completionHanler:
iOS 10.0以上可用
options参数是一个字典
@{UIApplicationOpenURLOptionUniversalLinksOnly:@(YES)}

application:handleOpenURL:
iOS[2.0, 9.0)可用

application:openURL:sourceApplication:annotation:
iOS[4.2, 9.0)可用

application:openURL:options:
iOS 9.0以上可用

上一篇下一篇

猜你喜欢

热点阅读