iOS 9 not opening Instagram app with URL SCHEME

后端 未结 14 2069
攒了一身酷
攒了一身酷 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:22

    In Swift 4.2 and Xcode 10.1

    In info.plist need to add CFBundleURLSchemes and LSApplicationQueriesSchemes.

    --> Select info.plist in your project,

    --> right click,

    --> Select Open As Source Code

    See the below screen shot

    --> xml file will be opened

    --> copy - paste below code and replace with your ID's

    CFBundleURLSchemes and LSApplicationQueriesSchemes for gmail, fb, twitter and linked in.

    CFBundleURLTypes
        
        
            CFBundleTypeRole
            Editor
            CFBundleURLSchemes
            
                li5****5
                com.googleusercontent.apps.8***************5f
                fb8***********3
                twitterkit-s***************w
            
        
    
    FacebookAppID
    8*********3
    FacebookDisplayName
    K************ app
    LSApplicationQueriesSchemes
    
        fbapi
        fb-messenger-share-api
        fbauth2
        fbshareextension
    
        twitter
        twitterauth
    
        linkedin
        linkedin-sdk2
        linkedin-sdk
    
    
    

    See below screen your final info.plist file is

提交回复
热议问题