2017-03-29 3 views
2

このようにFacebookのアプリでURLを開くときに使用します。私はpuffinブラウザでURLを開きたいiosアプリでSafariブラウザではなくpuffinブラウザでURLをリダイレクトする方法はありますか?

if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"fb://"]]) { 
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"fb://profile/355356557838717"]]; 
} 
else { 
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://www.facebook.com/DanielStormApps"]]; 
} 

答えて

1
  let urlPath: String = "puffin://www.facebook.com" 

      let url: NSURL = NSURL(string: urlPath)! 

      let isInstalled = UIApplication.sharedApplication().canOpenURL(url) 

      if isInstalled { 

       print("Installed") 

      }else{ 

       print(" Not Installed") 
      } 
0

あなたはそのタイプのURLを開いている

<key>LSApplicationQueriesSchemes</key> 
<array> 
    <string>fb</string> 
</array> 

をinfoplistファイルを追加します:[NSURL URLWithString: "FB://プロファイル/ 355356557838717" @]

+0

私はpuffinブラウザのこの種のものを追加したい –

1

をあなたは「ツノメドリを使用することができます//'を押してhttpでURLを開きます。または、「puffins://」を使用してhttpsでURLを開きます。

関連する問題