From 78ee77f49122ac525590715a0a034965e3e59adf Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 4 Oct 2016 15:04:04 +0200 Subject: iOS: link photo lib plugin based on Info.plist contents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the application's Info.plist contains the key 'NSPhotoLibraryUsageDescription', we know that we can safely link in qiosnsphotolibrarysupport without violating AppStore requirements. This is a simple feature that doesn't introduce additional qmake API for doing app deployment with optional iOS QPA plugins. [ChangeLog][iOS] Starting from iOS 10, Apple requires all apps that need access to photos to have the key 'NSPhotoLibraryUsageDescription' in the Info.plist. Therefore, to get the same support in Qt (when, e.g., using a file dialog), the Info.plist assigned to QMAKE_INFO_PLIST will need this key as well. Change-Id: I7a93afe24b589cad96d5a1d9e2a155ad1671178a Reviewed-by: Tor Arne Vestbø Reviewed-by: Jake Petroules --- mkspecs/macx-ios-clang/features/default_post.prf | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mkspecs') diff --git a/mkspecs/macx-ios-clang/features/default_post.prf b/mkspecs/macx-ios-clang/features/default_post.prf index 4c8a6eaae6..93e9e10ec3 100644 --- a/mkspecs/macx-ios-clang/features/default_post.prf +++ b/mkspecs/macx-ios-clang/features/default_post.prf @@ -80,3 +80,11 @@ macx-xcode { QMAKE_CXXFLAGS += $$arch_flags QMAKE_LFLAGS += $$arch_flags } + +!xcodebuild:equals(TEMPLATE, app):!isEmpty(QMAKE_INFO_PLIST) { + # Only link in photo library support if Info.plist contains + # NSPhotoLibraryUsageDescription. Otherwise it will be rejected from AppStore. + plist_path = $$absolute_path($$QMAKE_INFO_PLIST, $$_PRO_FILE_PWD_) + system("/usr/libexec/PlistBuddy -c 'Print NSPhotoLibraryUsageDescription' $$system_quote($$plist_path) &>/dev/null"): \ + QTPLUGIN += qiosnsphotolibrarysupport +} -- cgit v1.2.3