Expensify / react-native-share-menu

A module for React Native that adds your app to the share menu of the device
MIT License
653 stars 237 forks source link

[iOS] Share Extension doesn't work when built with M1 processor #199

Open vygandas opened 2 years ago

vygandas commented 2 years ago

After a long investigation of what's going on, we found that the issue is in the M1 chip. When the app is built on an M1 machine, the Share Extension doesn't receive any shared data on real and on simulator devices. Archiving and sending it to TestFlight and opening it on the phone doesn't help either.

My colleague used the same code on an older MAC with an Intel chip and it worked on the simulator, a real device and also via TestFlight on the very same device where the M1 build wasn't working.

Reading issues here I started getting an impression that maybe I'm missing something and it's not that big of a problem to build it correctly on my M1.

On the M1 build the app works fine, also Share Extension registers on the share menu on the phone. Selecting an app, adding text and seeing a preview is also ok (sometimes the image preview doesn't load, but probably not related). Took a while to figure that one out. 😅 Oh and also, XCode is set to use Rosetta on my machine.

So the question is - how can we build and make it work on M1?

Edit: sharing into the app partially works when I exclude arm64 from the build, but that partial sharing means only pictures or links from Safari; still can't share stuff from Photos for example. And also if I do this exclusion, I can't run it on a real device. So it's still messed up 😅

somasekharkakarla commented 2 years ago

Hi @vygandas , i am using M1 only which i bought 4 months back. it is working fine with me. For testing, it is also better to use real device

YanaSyritskaya commented 2 years ago

Hi @vygandas, also M1 bought 3 months ago, working fine.

kubik369 commented 2 years ago

+1 for working, I have been using it on a project with an M1 Macbook Air for more than a year now :) I would recommend cleaning up your dev environment and not using Rosetta in this case unless you have a good reason.