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

Commit

Permalink
[WEEX-297][iOS] fix iOS 11 save image permission
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil committed Apr 20, 2018
1 parent 519dd89 commit 14dbdc4
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 14dbdc4

Please sign in to comment.