check for NSPhotoLibraryUsageDescription in plist
Reviewed By: javache Differential Revision: D3723122 fbshipit-source-id: a5393c7dd3c36a15bec3f2e79859920419cc6726
This commit is contained in:
parent
ba17804764
commit
c4b9a1e013
|
@ -147,6 +147,8 @@ RCT_EXPORT_METHOD(getPhotos:(NSDictionary *)params
|
|||
resolve:(RCTPromiseResolveBlock)resolve
|
||||
reject:(RCTPromiseRejectBlock)reject)
|
||||
{
|
||||
checkPhotoLibraryConfig();
|
||||
|
||||
NSUInteger first = [RCTConvert NSInteger:params[@"first"]];
|
||||
NSString *afterCursor = [RCTConvert NSString:params[@"after"]];
|
||||
NSString *groupName = [RCTConvert NSString:params[@"groupName"]];
|
||||
|
@ -221,4 +223,13 @@ RCT_EXPORT_METHOD(getPhotos:(NSDictionary *)params
|
|||
}];
|
||||
}
|
||||
|
||||
static void checkPhotoLibraryConfig()
|
||||
{
|
||||
#if RCT_DEV
|
||||
if (![[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSPhotoLibraryUsageDescription"]) {
|
||||
RCTLogError(@"NSPhotoLibraryUsageDescription key must be present in Info.plist to use camera roll.");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue