2015-08-18 61 views
2

有没有人想过如何检测谷歌浏览器是否已安装,然后通过自己的应用程序通过链接传入iOS 9中打开它?谷歌的OpenInChrome无法检测或在iOS 9中打开谷歌浏览器应用程序9

我以前使用的是,推荐使用OpenInChromeController。 Google似乎没有为iOS 9更新该文档,并且OpenInChromeController似乎已被放弃。

+1

基于此[柱](http://awkwardhare.com/post/121196006730/quick-take-on-ios-9 -url-scheme-changes)我在我的info.plist URL Schemes中添加了“googlechrome”和“googlechromes”。我认为这可能会诀窍,但直到Google发布iOS 9的Chrome应用之前,我都不会知道。我认为这可能是我们在Google发布支持iOS 9的Chrome之前所能做出的最好猜测。 –

回答

1

我想通了这一点,你只需将它添加到您的plist作为LSApplicationQueriesSchemes,然后你可以使用canOpenUrl,看看是否安装该应用程序

<key>LSApplicationQueriesSchemes</key> <array> <string>urlscheme</string> <string>urlscheme2</string> <string>urlscheme3</string> <string>urlscheme4</string> </array>

4

我想更详细的回答可以是加入以下三种方案来LSApplicationQueriesSchemesYOURAPP-Info.plist

  • googlechrome
  • googlechromes
  • googlechrome-X-回调

更多细节请参考Cocoapods

相关问题