react-native/React/Base
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
..
RCTAssert.h Fix RCTAssert logic 2015-08-07 06:11:49 -08:00
RCTAssert.m Ran Convert > To Modern Objective C Syntax 2015-08-25 01:08:49 -08:00
RCTBatchedBridge.m Prepare the bridge for C++ 2015-09-18 15:04:28 -07:00
RCTBridge.h Remove isValid from RCTInvalidating 2015-08-14 01:57:18 -08:00
RCTBridge.m Small perf improvement to RCTPerfStats and RCTBridgeModuleNameForClass 2015-08-25 04:48:39 -08:00
RCTBridgeDelegate.h [ReactNative] Add RCTBridgeDelegate 2015-07-28 15:57:02 -08:00
RCTBridgeMethod.h Prepare the bridge for C++ 2015-09-18 15:04:28 -07:00
RCTBridgeModule.h Prepare the bridge for C++ 2015-09-18 15:04:28 -07:00
RCTCache.h Improved RCTCache performance + fixed border color crash 2015-07-14 04:56:25 -08:00
RCTCache.m Ran Convert > To Modern Objective C Syntax 2015-08-25 01:08:49 -08:00
RCTConvert.h Ran Convert > To Modern Objective C Syntax 2015-08-25 01:08:49 -08:00
RCTConvert.m Move color processing to JS 2015-09-17 17:20:45 -07:00
RCTDefines.h Increased warning levels to -Wall -Wextra, and fixed Xcode 7 beta issues 2015-06-15 07:52:50 -08:00
RCTEventDispatcher.h Small perf improvement to RCTPerfStats and RCTBridgeModuleNameForClass 2015-08-25 04:48:39 -08:00
RCTEventDispatcher.m Small perf improvement to RCTPerfStats and RCTBridgeModuleNameForClass 2015-08-25 04:48:39 -08:00
RCTFPSGraph.h #1562 Rename 'tick' to 'onTick' to pass iTunes Connect validation. 2015-06-29 06:51:44 -08:00
RCTFPSGraph.m Ran Convert > To Modern Objective C Syntax 2015-08-25 01:08:49 -08:00
RCTFrameUpdate.h [ReactNative] Move module info from bridge to RCTModuleData 2015-06-24 17:42:12 -08:00
RCTFrameUpdate.m Ran Convert > To Modern Objective C Syntax 2015-08-25 01:08:49 -08:00
RCTInvalidating.h Remove isValid from RCTInvalidating 2015-08-14 01:57:18 -08:00
RCTJSMethodRegistrar.h Added non-class-scanning-based approach fror registering js methods 2015-04-08 05:45:20 -08:00
RCTJavaScriptExecutor.h Remove isValid from RCTInvalidating 2015-08-14 01:57:18 -08:00
RCTJavaScriptLoader.h [ReactNative] Add RCTBridgeDelegate 2015-07-28 15:57:02 -08:00
RCTJavaScriptLoader.m Added clarifying language to error for not finding development server 2015-09-01 05:25:56 -08:00
RCTKeyCommands.h Updates from Thu 26 Mar 2015-03-26 06:32:01 -07:00
RCTKeyCommands.m Ran Convert > To Modern Objective C Syntax 2015-08-25 01:08:49 -08:00
RCTKeyboardObserver.h Add keyboard-observing notifications 2015-08-25 03:49:13 -08:00
RCTKeyboardObserver.m Add KeyboardAvoidingView 2015-09-02 09:17:20 -08:00
RCTLog.h Added support for method argument nullability 2015-07-29 05:50:27 -08:00
RCTLog.m Use getters and setters 2015-09-13 11:10:29 -07:00
RCTModuleData.h Reverted to pre-init of queues to fix UIExplorer tests. 2015-08-08 01:47:43 -08:00
RCTModuleData.m Prepare the bridge for C++ 2015-09-18 15:04:28 -07:00
RCTModuleMap.h Unregistered modules will now only error when called, not on bridge init 2015-07-27 08:58:47 -08:00
RCTModuleMap.m Ran Convert > To Modern Objective C Syntax 2015-08-25 01:08:49 -08:00
RCTModuleMethod.h Prepare the bridge for C++ 2015-09-18 15:04:28 -07:00
RCTModuleMethod.m Prepare the bridge for C++ 2015-09-18 15:04:28 -07:00
RCTPerfStats.h [ReactNative] Add fps monitor 2015-05-20 18:26:36 -08:00
RCTPerfStats.m App Extension support 2015-09-22 10:46:26 -07:00
RCTPerformanceLogger.h Cleanup bridge init, measure native module init time 2015-08-21 12:32:25 -07:00
RCTPerformanceLogger.m Cleanup bridge init, measure native module init time 2015-08-21 12:32:25 -07:00
RCTProfile.h Automatically save and convert JavaScript profile to chrome format 2015-09-11 06:40:26 -07:00
RCTProfile.m Automatically save and convert JavaScript profile to chrome format 2015-09-11 06:40:26 -07:00
RCTRootView.h Avoid dispatch_async in RCTRootView when bridge has already started 2015-08-17 05:34:25 -07:00
RCTRootView.m Make RCTTestRunner wait for JS context to deallocate 2015-09-04 03:24:16 -08:00
RCTSparseArray.h Updates from Thu 26 Mar 2015-03-26 06:32:01 -07:00
RCTSparseArray.m Ran Convert > To Modern Objective C Syntax 2015-08-25 01:08:49 -08:00
RCTTouchHandler.h [ReactNative] Send batched calls from objc to js every frame + add bridge profiling 2015-04-17 04:01:02 -08:00
RCTTouchHandler.m Ran Convert > To Modern Objective C Syntax 2015-08-25 01:08:49 -08:00
RCTURLRequestDelegate.h Refactored networking logic out into RCTDownloadTask 2015-07-23 04:00:31 -08:00
RCTURLRequestHandler.h [ReactNative] Refactor RCTDataManager to support pluggable data source modules (RCTURLRequestHandlers) 2015-06-09 12:27:06 -08:00
RCTUtils.h App Extension support 2015-09-22 10:46:26 -07:00
RCTUtils.m App Extension support 2015-09-22 10:46:26 -07:00