如何重定向 URL 以在海雀浏览器中打开,而不是在 ios 应用程序中的 safari 浏览器中打开



就像我们在Facebook应用程序中使用它来打开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"]];
}
            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")
            }

您可以使用"puffin://"在http中打开URL。或者使用"puffins://"在 https 中打开网址。

添加信息列表文件

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

您正在打开该类型网址:[NSURL URLWithString:@"fb://profile/355356557838717"]

最新更新