react-native/Libraries/CameraRoll
Yusef Napora 2f9bd1f62f App Extension support
Summary: This adds workarounds for the code that was preventing React from compiling when linked against an iOS App Extension target.

Some iOS APIs are unavailable to App Extensions, and Xcode's static analysis will catch attempts to use methods that have been flagged as unavailable.

React currently uses two APIs that are off limits to extensions: `[UIApplication sharedApplication]` and `[UIAlertView initWith ...]`.

This commit adds a helper function to `RCTUtils.[hm]` called `RCTRunningInAppExtension()`, which returns `YES` if, at runtime, it can be determined that we're running in an app extension (by checking whether the path to `[NSBundle mainBundle]` has the `"appex"` path extension).

It also adds a `RCTSharedApplication()` function, which will return `nil` if running in an App Extension. If running in an App, `RCTSharedApplication()` calls `sharedApplication` by calling `performSelector:` on the `UIApplication` class.  This passes the static analysis check, and, in my opinion, obeys the "spirit of th
Closes https://github.com/facebook/react-native/pull/1895

Reviewed By: @​svcscm

Differential Revision: D2224128

Pulled By: @nicklockwood
2015-09-22 10:46:26 -07:00
..
RCTCameraRoll.xcodeproj Moved CameraRoll-related classes into CameraRoll folder instead of Image 2015-09-08 09:48:19 -08:00
CameraRoll.js [ReactNative] CameraRoll docs 2015-07-27 09:46:35 -08:00
ImagePickerIOS.js Moved CameraRoll-related classes into CameraRoll folder instead of Image 2015-09-08 09:48:19 -08:00
RCTAssetsLibraryImageLoader.h Moved CameraRoll-related classes into CameraRoll folder instead of Image 2015-09-08 09:48:19 -08:00
RCTAssetsLibraryImageLoader.m Moved CameraRoll-related classes into CameraRoll folder instead of Image 2015-09-08 09:48:19 -08:00
RCTCameraRollManager.h Moved CameraRoll-related classes into CameraRoll folder instead of Image 2015-09-08 09:48:19 -08:00
RCTCameraRollManager.m Moved CameraRoll-related classes into CameraRoll folder instead of Image 2015-09-08 09:48:19 -08:00
RCTImagePickerManager.h Moved CameraRoll-related classes into CameraRoll folder instead of Image 2015-09-08 09:48:19 -08:00
RCTImagePickerManager.m App Extension support 2015-09-22 10:46:26 -07:00
RCTPhotoLibraryImageLoader.h Moved CameraRoll-related classes into CameraRoll folder instead of Image 2015-09-08 09:48:19 -08:00
RCTPhotoLibraryImageLoader.m Moved CameraRoll-related classes into CameraRoll folder instead of Image 2015-09-08 09:48:19 -08:00