Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

[WEEX-297][iOS] fix iOS 11 save image permission #1119

Merged
merged 1 commit into from
Apr 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down