alinz / react-native-share-extension

react-native as an engine to drive share extension
MIT License
762 stars 396 forks source link

IOS Share Extension is displayed but not able to open UI which is written in share.ios.js #165

Closed Shaktis3 closed 5 years ago

Shaktis3 commented 5 years ago

I have followed the same steps with same name "MyShareEx". Now the extension is displayed while sharing but on clicking it, it freezes the app through which i'm sharing the link.

My code is same as given in README file

Please help ASAP.

Shaktis3 commented 5 years ago

I got the issue resolved after commenting all code in MyApp. I would like to mention - registering component like this was the issue

AppRegistry.registerComponent('MyApp', () => App);
AppRegistry.registerComponent('MyShareEx', () => Share) 

There were dependencies like linked libraries etc which were configured for MyApp but not for MyShareEx. So either configure your MyShareExt as MyApp (I will not recommend this) OR create separate entry point like share.ios.js and register only share component there.

AppRegistry.registerComponent('MyShareEx', () => Share) 

and in MyShareEx.m change @"index" to @"share.ios". That's all.

Also search "Separated bundles" at this repository's github page for more help. I hope it will help others.