diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-07-09 14:03:58 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-07-09 23:09:34 +0000 |
commit | d27dd47ffa7bef94ffd18977b1bcbc970e1a72e4 (patch) | |
tree | e997947422240fd77518675abf8f27d947fca44c /src/gui | |
parent | 5b8702fd557afa9d5e426b669b61ed65d8368da0 (diff) | |
download | qtbase-d27dd47ffa7bef94ffd18977b1bcbc970e1a72e4.tar.gz |
iOS: Document how to handle URL requests from external applications
Change-Id: Ideeb0b06b6c7fc792e2102eb71296e99f3023842
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/util/qdesktopservices.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp index dfd190ddd0..de9d087c21 100644 --- a/src/gui/util/qdesktopservices.cpp +++ b/src/gui/util/qdesktopservices.cpp @@ -141,6 +141,10 @@ void QOpenUrlHandlerRegistry::handlerDestroyed(QObject *handler) same argument, and it will try to open the URL using the appropriate mechanism for the user's desktop environment. + Combined with platform specific settings, the schemes registered by the + openUrl() function can also be exposed to other applications, opening up + for application deep linking or a very basic URL-based IPC mechanism. + \note Since Qt 5, storageLocation() and displayName() are replaced by functionality provided by the QStandardPaths class. @@ -245,6 +249,24 @@ bool QDesktopServices::openUrl(const QUrl &url) The provided method must be implemented as a slot that only accepts a single QUrl argument. + To use this function for receiving data from other apps on iOS you also need to + add the custom scheme to the \c CFBundleURLSchemes list in your Info.plist file: + + \code + <key>CFBundleURLTypes</key> + <array> + <dict> + <key>CFBundleURLSchemes</key> + <array> + <string>myapp</string> + </array> + </dict> + </array> + \endcode + + For more information, see the Apple Developer Documentation for + \l{https://developer.apple.com/documentation/uikit/core_app/allowing_apps_and_websites_to_link_to_your_content/communicating_with_other_apps_using_custom_urls?language=objc}{Communicating with Other Apps Using Custom URLs}. + If setUrlHandler() is used to set a new handler for a scheme which already has a handler, the existing handler is simply replaced with the new one. Since QDesktopServices does not take ownership of handlers, no objects are |