iOS 9 not opening Instagram app with URL SCHEME

后端 未结 14 1892
攒了一身酷
攒了一身酷 2020-11-22 06:33

The following URL opens on iOS 8.3 and lower, but it does not work and iOS 9

let instagramURL = NSURL(string: \"instagram://app\")

Why won\

相关标签:
14条回答
  • 2020-11-22 07:06

    It is important to note that there was a bug with jailbroken phones on 9.0.x which broke url schemes. If you're running a jailbroken device then make sure you update Patcyh in Cydia

    0 讨论(0)
  • 2020-11-22 07:07

    From, Session 703 WWDC 2015:

    You can continue to use URL schemes when you build your app for iOS 9 and you want to call URL schemes, you will now need to declare them in your apps Info.plist. There is a new key, LSApplicationQueriesSchemes, and here you will need to add the list of schemes you want to are canOpenURL on.

    0 讨论(0)
  • 2020-11-22 07:08

    iOS 9 has made a small change to the handling of URL scheme. You must whitelist the url's that your app will call out to using the LSApplicationQueriesSchemes key in your Info.plist.

    Please see post here: http://awkwardhare.com/post/121196006730/quick-take-on-ios-9-url-scheme-changes

    The main conclusion is that:

    If you call the “canOpenURL” method on a URL that is not in your whitelist, it will return “NO”, even if there is an app installed that has registered to handle this scheme. A “This app is not allowed to query for scheme xxx” syslog entry will appear.

    If you call the “openURL” method on a URL that is not in your whitelist, it will fail silently. A “This app is not allowed to query for scheme xxx” syslog entry will appear.

    The author also speculates that this is a bug with the OS and Apple will fix this in a subsequent release.

    0 讨论(0)
  • 2020-11-22 07:10

    This is a new security feature of iOS 9. Watch WWDC 2015 Session 703 for more information.

    Any app built with SDK 9 needs to provide a LSApplicationQueriesSchemes entry in its plist file, declaring which schemes it attempts to query.

    <key>LSApplicationQueriesSchemes</key>
    <array>
     <string>urlscheme</string>
     <string>urlscheme2</string>
     <string>urlscheme3</string>
     <string>urlscheme4</string>
    </array> 
    
    0 讨论(0)
  • 2020-11-22 07:10

    Assuming two apps TestA and TestB. TestB wants to query if TestA is installed. "TestA" defines the following URL scheme in its info.plist file:

    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>testA</string>
            </array>
        </dict>
    </array>
    

    The second app "TestB" tries to find out if "TestA" is installed by calling:

    [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"TestA://"]];
    

    But this will normally return NO in iOS9 because "TestA" needs to be added to the LSApplicationQueriesSchemes entry in TestB's info.plist file. This is done by adding the following code to TestB's info.plist file:

    <key>LSApplicationQueriesSchemes</key>
    <array>
        <string>TestA</string>
    </array>
    

    A working implementation can be found here: https://github.com/gatzsche/LSApplicationQueriesSchemes-Working-Example

    0 讨论(0)
  • 2020-11-22 07:12

    For PayPal add below URL schemes :

    Refer this link

    0 讨论(0)
提交回复
热议问题