OLD | NEW |
1 # Opening links in Chrome for iOS</h1> | 1 # Opening links in Chrome for iOS |
2 | 2 |
3 The easiest way to have your iOS app open links in Chrome is to use the | 3 The easiest way to have your iOS app open links in Chrome is to use the |
4 [OpenInChromeController](https://github.com/GoogleChrome/OpenInChrome) class. | 4 [OpenInChromeController](https://github.com/GoogleChrome/OpenInChrome) class. |
5 This API is described here along with the URI schemes it supports. | 5 This API is described here along with the URI schemes it supports. |
6 | 6 |
7 ## Using OpenInChromeController to open links | 7 ## Using OpenInChromeController to open links |
8 | 8 |
9 The **OpenInChromeController** class provides methods that | 9 The **OpenInChromeController** class provides methods that |
10 encapsulate the URI schemes and the scheme replacement process also described | 10 encapsulate the URI schemes and the scheme replacement process also described |
11 in this document. Use this class to check if Chrome is installed or to specify | 11 in this document. Use this class to check if Chrome is installed or to specify |
12 the URL to open. | 12 the URL to open. |
13 | 13 |
14 ### Methods | 14 ### Methods |
15 | 15 |
16 * `isChromeInstalled`: returns YES if Chrome is installed</li> | 16 * `isChromeInstalled`: returns YES if Chrome is installed |
17 * `openInChrome`: opens a given URL in Chrome</li> | 17 * `openInChrome`: opens a given URL in Chrome |
18 | 18 |
19 For example, use the OpenInChromeController class as follows: | 19 For example, use the OpenInChromeController class as follows: |
20 | 20 |
21 ``` | 21 ``` |
22 if ([openInController_ isChromeInstalled]) { | 22 if ([openInController_ isChromeInstalled]) { |
23 [openInController_ openInChrome:urlToOpen]; | 23 [openInController_ openInChrome:urlToOpen]; |
24 } | 24 } |
25 ``` | 25 ``` |
26 | 26 |
27 ## Downloading the class file | 27 ## Downloading the class file |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 the URL to the Google Chrome equivalent. When Google Chrome opens, the | 86 the URL to the Google Chrome equivalent. When Google Chrome opens, the |
87 URL passed as a parameter will be opened in a new tab. | 87 URL passed as a parameter will be opened in a new tab. |
88 | 88 |
89 If Chrome is not installed the user can be prompted to download it from the App
Store. | 89 If Chrome is not installed the user can be prompted to download it from the App
Store. |
90 If the user agrees, the app can open the App Store download page using the follo
wing: | 90 If the user agrees, the app can open the App Store download page using the follo
wing: |
91 | 91 |
92 ``` | 92 ``` |
93 [[UIApplication sharedApplication] openURL:[NSURL URLWithString: | 93 [[UIApplication sharedApplication] openURL:[NSURL URLWithString: |
94 @"itms-apps://itunes.apple.com/us/app/chrome/id535886823"]]; | 94 @"itms-apps://itunes.apple.com/us/app/chrome/id535886823"]]; |
95 ``` | 95 ``` |
OLD | NEW |