Ios 如何使用Swift代码打开Patreon应用程序
我正在寻找下面的代码,我们可以打开facebook或twitter的iOS应用程序,但有没有一种方法可以为Patreon应用程序做到这一点Ios 如何使用Swift代码打开Patreon应用程序,ios,swift,patreon,Ios,Swift,Patreon,我正在寻找下面的代码,我们可以打开facebook或twitter的iOS应用程序,但有没有一种方法可以为Patreon应用程序做到这一点 let appURL = NSURL(string: "fb://profile/\(facebook)")! let webURL = NSURL(string: "https://www.facebook.com/\(facebook)")! let application = UIApplication.shared
let appURL = NSURL(string: "fb://profile/\(facebook)")!
let webURL = NSURL(string: "https://www.facebook.com/\(facebook)")!
let application = UIApplication.shared
if application.canOpenURL(appURL as URL) {
application.open(appURL as URL)
} else {
application.open(webURL as URL)
}
我还在Info.plist中列出了以下几行:
<array>
<string>instagram</string>
<string>fb</string>
</array>
instagram
食品饮料
请您帮助我,让我知道如何在
info.plist
上添加Patreon应用程序?尝试以下代码
在Plist文件中,添加以下内容-
<string>com.patreon.iphone</string>
电话:
self.open(方案:“com.patreon.iphone:/”)
注意:并非所有应用程序都具有Url架构。如果您需要了解URL模式,请下载IPA并使用此Apple Configurator 2查看第三方应用程序的plist文件。这里有一个有用的说明。我写这篇评论是为了让你知道我昨天发现了解决方案:
let webURL = NSURL(string: "https://www.patreon.com/\(patreonUserName)")!
let application = UIApplication.shared
application.open(webURL as URL)
这解决了我的问题,我幸运地发现:)
致以最良好的祝愿
let webURL = NSURL(string: "https://www.patreon.com/\(patreonUserName)")!
let application = UIApplication.shared
application.open(webURL as URL)