且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何通过点击Swift中的按钮打开fb和instagram应用程序

更新时间:2023-01-01 23:04:58

看看这些链接,它可以帮助您:

Take a look on these links, it can help you:

https ://instagram.com/developer/mobile-sharing/iphone-hooks/

http://wiki.akosma.com/IPhone_URL_Schemes

在iOS上打开Facebook应用程序的Facebook链接

否则有一个Instagram的例子,用于打开特定的个人资料(昵称:johndoe here):

Otherwise there is a quick example with Instagram for opening a specific profile (nickname : johndoe here) :

  var instagramHooks = "instagram://user?username=johndoe"
        var instagramUrl = NSURL(string: instagramHooks)
        if UIApplication.sharedApplication().canOpenURL(instagramUrl!)
        {  
UIApplication.sharedApplication().openURL(instagramUrl!)

         } else {
                  //redirect to safari because the user doesn't have Instagram
                    UIApplication.sharedApplication().openURL(NSURL(string: "http://instagram.com/")!)
        }