diff --git a/RCTCameraRollManager.m b/RCTCameraRollManager.m index f8e6346df..64cf734b1 100644 --- a/RCTCameraRollManager.m +++ b/RCTCameraRollManager.m @@ -80,8 +80,8 @@ RCT_EXPORT_MODULE() @synthesize bridge = _bridge; -NSString *const RCTErrorUnableToLoad = @"E_UNABLE_TO_LOAD"; -NSString *const RCTErrorUnableToSave = @"E_UNABLE_TO_SAVE"; +static NSString *const kErrorUnableToLoad = @"E_UNABLE_TO_LOAD"; +static NSString *const kErrorUnableToSave = @"E_UNABLE_TO_SAVE"; RCT_EXPORT_METHOD(saveToCameraRoll:(NSURLRequest *)request type:(NSString *)type @@ -93,7 +93,7 @@ RCT_EXPORT_METHOD(saveToCameraRoll:(NSURLRequest *)request dispatch_async(dispatch_get_main_queue(), ^{ [self->_bridge.assetsLibrary writeVideoAtPathToSavedPhotosAlbum:request.URL completionBlock:^(NSURL *assetURL, NSError *saveError) { if (saveError) { - reject(RCTErrorUnableToSave, nil, saveError); + reject(kErrorUnableToSave, nil, saveError); } else { resolve(assetURL.absoluteString); } @@ -103,7 +103,7 @@ RCT_EXPORT_METHOD(saveToCameraRoll:(NSURLRequest *)request [_bridge.imageLoader loadImageWithURLRequest:request callback:^(NSError *loadError, UIImage *loadedImage) { if (loadError) { - reject(RCTErrorUnableToLoad, nil, loadError); + reject(kErrorUnableToLoad, nil, loadError); return; } // It's unclear if writeImageToSavedPhotosAlbum is thread-safe @@ -111,7 +111,7 @@ RCT_EXPORT_METHOD(saveToCameraRoll:(NSURLRequest *)request [self->_bridge.assetsLibrary writeImageToSavedPhotosAlbum:loadedImage.CGImage metadata:nil completionBlock:^(NSURL *assetURL, NSError *saveError) { if (saveError) { RCTLogWarn(@"Error saving cropped image: %@", saveError); - reject(RCTErrorUnableToSave, nil, saveError); + reject(kErrorUnableToSave, nil, saveError); } else { resolve(assetURL.absoluteString); } @@ -230,7 +230,7 @@ RCT_EXPORT_METHOD(getPhotos:(NSDictionary *)params if (error.code != ALAssetsLibraryAccessUserDeniedError) { RCTLogError(@"Failure while iterating through asset groups %@", error); } - reject(RCTErrorUnableToLoad, nil, error); + reject(kErrorUnableToLoad, nil, error); }]; }