Jumping from this facebook / react-native # 1626 GitHub issue , I had a question about setting up the React Native view in <extension href = "https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/ ShareSheet.html # // apple_ref / doc / uid / TP40014214-CH12-SW1 "rel =" nofollow "> iOS
I posted an example of a GitHub repo that demonstrates the problem summarized below.
So far, setting up proof of concept is pretty straightforward, but I feel like I'm missing something very simple.
In my xcode project, react-native initI created a new extension target for sharing, and inside it linked the corresponding static React Native libraries ( libReact.a, libRCTWebSocket.aetc.). This allows us to compile our project for a very simple oneShareViewController , which is simple "ol UIViewController.
After activating my sharing extension from another application, mine is ShareViewControllerinitialized, but immediately crashes with the following log messages:
2015-11-29 12:44:34.721 [warn][tid:com.facebook.React.JavaScript][RCTContextExecutor.m:129] 'undefined is not an object (evaluating \'RCTWebSocketModule.connect\')'
2015-11-29 12:44:34.726 ShareExtension[66473:2179009] -[RCTBatchedBridge redBox]: unrecognized selector sent to instance 0x7fb59d8ab200
2015-11-29 12:53:47.160 [warn][tid:com.facebook.React.JavaScript][RCTContextExecutor.m:129] 'Requiring module "InitializeJavaScriptAppEngine" which threw an exception'
2015-11-29 12:53:47.160 ShareExtension[66473:2179009] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RCTBatchedBridge redBox]: unrecognized selector sent to instance 0x7fb59d8ab200'
The line 'Requiring module "InitializeJavaScriptAppEngine" which threw an exception'looks especially suspicious and leads me to believe that I am missing a basic JavaScriptCore installation in the share extension. It is curious to find out if there are any obvious areas to investigate, or if someone else has solved this problem. Thanks!