From d27dd47ffa7bef94ffd18977b1bcbc970e1a72e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 9 Jul 2018 14:03:58 +0200 Subject: iOS: Document how to handle URL requests from external applications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ideeb0b06b6c7fc792e2102eb71296e99f3023842 Reviewed-by: Tor Arne Vestbø --- src/gui/util/qdesktopservices.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src') 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 + CFBundleURLTypes + + + CFBundleURLSchemes + + myapp + + + + \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 -- cgit v1.2.3