react-native-macos/React/Modules
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
..
RCTAccessibilityManager.h Use Dynamic Text Size Multipliers from Wilde in ReactNative Module 2015-08-07 03:18:20 -08:00
RCTAccessibilityManager.m Ran Convert > To Modern Objective C Syntax 2015-08-25 01:08:49 -08:00
RCTAlertManager.h Remove an existing UIAlertViews when invalidating the RCTAlertManager 2015-09-18 08:45:27 -07:00
RCTAlertManager.m App Extension support 2015-09-22 10:46:26 -07:00
RCTAppState.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTAppState.m App Extension support 2015-09-22 10:46:26 -07:00
RCTAsyncLocalStorage.h Remove isValid from RCTInvalidating 2015-08-14 01:57:18 -08:00
RCTAsyncLocalStorage.m Ran Convert > To Modern Objective C Syntax 2015-08-25 01:08:49 -08:00
RCTDevLoadingView.h [RCTDevLoadingView] Add ability to disable during development. 2015-09-04 03:46:06 -08:00
RCTDevLoadingView.m [RCTDevLoadingView] Add ability to disable during development. 2015-09-04 03:46:06 -08:00
RCTDevMenu.h Added toggle items to dev menu 2015-09-14 09:40:33 -07:00
RCTDevMenu.m App Extension support 2015-09-22 10:46:26 -07:00
RCTExceptionsManager.h Finish up the work to send through the error cookie 2015-09-17 18:15:27 -07:00
RCTExceptionsManager.m Finish up the work to send through the error cookie 2015-09-17 18:15:27 -07:00
RCTPointAnnotation.h [MapView] Support for annotation callouts, annotation press, callout presses and pin animation 2015-06-25 09:15:21 -08:00
RCTPointAnnotation.m [MapView] Support for annotation callouts, annotation press, callout presses and pin animation 2015-06-25 09:15:21 -08:00
RCTRedBox.h Converted RCTRedBox to a bridge module 2015-08-21 02:53:55 -07:00
RCTRedBox.m App Extension support 2015-09-22 10:46:26 -07:00
RCTSourceCode.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTSourceCode.m [React Native] Bring back .sourceURL 2015-09-02 14:12:48 -08:00
RCTStatusBarManager.h Removed deprecated RCT_EXPORT + code paths 2015-06-05 09:58:25 -08:00
RCTStatusBarManager.m App Extension support 2015-09-22 10:46:26 -07:00
RCTTiming.h [ReactNative] Use a single DisplayLink held by the bridge 2015-04-15 07:07:48 -08:00
RCTTiming.m Ran Convert > To Modern Objective C Syntax 2015-08-25 01:08:49 -08:00
RCTUIManager.h Add doc comment for mainScrollView 2015-08-21 04:00:03 -07:00
RCTUIManager.m Fixed layout animation crash 2015-09-04 05:34:46 -08:00