react-native-share-menu icon indicating copy to clipboard operation
react-native-share-menu copied to clipboard

Custom Share Extension is not working in react native 0.61.5

Open ilijaprzeski opened this issue 3 years ago • 8 comments

Custom share extension view is blank in react-native 0.61.5

Screen Shot 2021-05-10 at 10 59 33 PM

Please let me know how I can solve this problem.

ilijaprzeski avatar May 10 '21 21:05 ilijaprzeski

Can you show the contents of index.share.js file ??

quriosapien avatar May 14 '21 05:05 quriosapien

Hi, @ikmrgrv This is original file in exmaple project.

ilijaprzeski avatar May 20 '21 22:05 ilijaprzeski

Ok. Anything in logs ?? any error or warning ??

Also, I followed the same instructions and I could get it working fine !

quriosapien avatar May 22 '21 17:05 quriosapien

I have the same issue here. I just copied the example of Share.js and index.share.js

No error or warning.

react-native: 0.61.5 react-native-share-menu: 5.0.3

jcmlumacad avatar May 26 '21 09:05 jcmlumacad

same issue here:

react-native: 0.61.5 react-native-share-menu: 5.0.3

walidsahli avatar Aug 04 '21 15:08 walidsahli

Ok. Anything in logs ?? any error or warning ??

Also, I followed the same instructions and I could get it working fine !

I got it working for me. The problem was, in the build phase with Release scheme, it was not pointing to index.share.js properly. Hence, though it was working for me in the simulator, it wasn't working properly in real device.

Fortunately, it's working for me now!

quriosapien avatar Aug 11 '21 17:08 quriosapien

@ikmrgrv Could you point out what was wrong with the path to your index.share.js file?

export ENTRY_FILE=index.share.js

ghost avatar Oct 22 '21 22:10 ghost

Same problem here, debug build works but release cannot load the bundle when custom view is used. @ikmrgrv Can you remember what you changed to allow the index.share.js bundle to be loaded? The build process seems to work fine and bundles my index.share.js to a file called main.jsbundle, it just doesn't seem to be able to load it in the ReactShareViewController.swift swift file when it does:

return Bundle.main.url(forResource: "main", withExtension: "jsbundle")

The error I see in the iphone logs for my share extension app is

Terminating app due to uncaught exception 'RCTFatalException: Could not get BatchedBridge, make sure your bundle is packaged correctly', reason: 'Could not get BatchedBridge, make sure your bundle is packaged correctly'

I have a hunch it's something to do with the main app also being bundled as main.jsbundle but I don't really know much about how the process it supposed to work. I guess it's time to try and understand a bit more about swift and what's going on! 🤷

iamalismith avatar Oct 11 '23 09:10 iamalismith