react-native/React
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
..
Base App Extension support 2015-09-22 10:46:26 -07:00
Executors Automatically start JSC profiling if enabled on last run 2015-09-15 02:55:26 -07:00
Layout pull in github css-layout into fbobjc react native 2015-09-20 20:35:29 -07:00
Modules App Extension support 2015-09-22 10:46:26 -07:00
React.xcodeproj [ReactNative][Profiler] Update OSS build script to work with new makefile 2015-09-08 05:59:07 -08:00
Views pull in github css-layout into fbobjc react native 2015-09-20 20:35:29 -07:00