From 14dbdc48aa49ceeec3e407cf0f796147079a187f Mon Sep 17 00:00:00 2001 From: Phil Date: Fri, 20 Apr 2018 11:20:00 +0800 Subject: [PATCH] [WEEX-297][iOS] fix iOS 11 save image permission --- ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m index 2cd2646b9b..a27062d6ca 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m @@ -166,11 +166,11 @@ - (void)save:(WXKeepAliveCallback)resultCallback // iOS 11 needs a NSPhotoLibraryUsageDescription key for permission if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"11.0")) { - if (!info[@"NSPhotoLibraryUsageDescription"]) { + if (!info[@"NSPhotoLibraryAddUsageDescription"]) { if (resultCallback) { resultCallback(@{ @"success" : @(false), - @"errorDesc": @"This maybe crash above iOS 10 because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data." + @"errorDesc": @"This maybe crash above iOS 11 because it attempted to save image without a usage description. The app's Info.plist must contain an NSPhotoLibraryAddUsageDescription key with a string value explaining to the user how the app uses this data." }, NO); } return;