openURL() function of the UIApplication class to let the iOS open a URL in the app that has registered the URL scheme of this URL. The http and https schemes are always forwarded to the default browser (if iCab Mobile is the default browser, iCab Mobile will also open this page). If you want to open a page in iCab Mobile without necessarily being the default browser, you can use the schemes icabmobile and icabmobiles, as well as web and webs instead of http and https (i.e. instead of 'https://apple.com/' you open e.g. 'icabmobiles://apple.com/').
A URL that corresponds to the X-Callback-URL protocol is structured as follows:
[scheme]://x-callback-url/[action]?
[action-parameters]&
[x-callback-parameters]
The value x-icabmobile must be used for iCab Mobile for [scheme].
[action] defines the command and [action-parameters] defines the parameters associated with the command.
The following commands and parameters are supported by iCab…
| Action | Required parameters Optional parameters |
Description |
|---|---|---|
| addBookmark | url=[url] title=[title] |
Saves a bookmark with URL [url] and title [title] |
| addQuickstarter | url=[url] title=[title] |
Adds a bookmark in the quickstarter, with URL [url] and title [title] |
| addReadingList | url=[url] title=[title] |
Adds an entry to the reading list, with URL [url] and title [title] |
| addSearchEngine | url=[url] title=[title] |
Adds the search engine with the name [title] and URL [url] to the list of search engines. The URL should either contain the placeholder '%@', which can be replaced by the search term during the search, or allow the search term to be appended to the end of the URL. |
| search | searchTerm= searchEngine= |
Starts a search with the search term [searchTerm] using the search engine [searchEngine]. If the latter is missing or the specified search engine is unknown, iCab Mobile uses the default search engine. |
| fullscreen | Enables the full screen mode | |
| normalmode | Disables the full screen mode | |
| open | url=[url] destination= destination= destination=
fullscreen=yes |
Opens the website specified by [url], either in the current tab, in a new tab in the foreground or background. The Fullscreen mode can also be optionally activated/deactivated. If you enter 'quickstarter:' in [url], the quickstarter opens. |
| download | url=[url] filename= referrer=[url] |
Starts the download from [url] and saves the file under the name [filename] (if specified). Optionally, the referrer can also be specified. |
[x-callback-parameters] defines wether a result is sent back to the app that opened the URL in iCab Mobile. If the app does not expect a response, the parameter remains empty. Otherwise, the following return parameters are supported:
| Parameter | Description |
|---|---|
| x-success=[url] | If successful, iCab opens the URL specified here, which should use the app scheme of the calling app as the URL scheme |
| x-error=[url] | In the event of an error, iCab opens the URL specified here, which should use the app scheme of the calling app as the URL scheme |
When building the URL for the X-Callback-URL protocol, please note that parameters must be separated by '&' and encoded using the 'percent-encoding' method
x-icabmobile://x-callback-url/open?
url=quickstarter:&
destination=newTab
Opens the iCab-Mobile website in the current tab and in fullscreen mode:
x-icabmobile://x-callback-url/open?
url=http://www.icab-mobile.de/&
destination=currentTab&
fullscreen=yes
Saves the iCab-Mobile page as a bookmark and reports the success or failure back to the app (with URL scheme yourapp)
x-icabmobile://x-callback-url/addBookmark?
url=http://www.icab-mobile.de/&
title=iCab%20Mobile%20Homepage&
x-success=yourapp://success-handler&
x-error=yourapp://error-hander