Expensify / react-native-share-menu

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

Share doesn't redirect to app (iOS) #157

Open davidsalib opened 2 years ago

davidsalib commented 2 years ago

I've tried with both the default Share popup, and a custom popup. In both cases, when I press "Post" or "Continue to App", the main app doesn't launch.

I verified that the HostAppBundleIdentifier and HostAppURLScheme are set properly in both the App and Share Extension Info.plist respectively.

Any ideas/advice is much appreciated!

ghost commented 2 years ago

Same here. More instructions on this would be much appreciated.

ghost commented 2 years ago

@davidsalib I noticed that on iOS for some types of files it does NOT launch the app at all. But when sharing an image for example it works. Did you manage to get it working with Android?

kubik369 commented 2 years ago

The instructions seem to be wrong and at least on iOS, the HostAppURLScheme requires the name to end with ://, e.g. if your app package is called myapp, then you need to use myapp://

robbiedood commented 2 years ago

@kubik369 Your solution works for me, thanks! BTW, do you know how could we directly share text to app without pressing "Post" or "Continue to App" in iOS ?

Hope to hear your expertise.

kubik369 commented 2 years ago

@lukelu0520 Hi, you should be able to open the app immediately when the user selects it in the share menu, you don't need to wait for any press as far as I know :)

robbiedood commented 2 years ago

@kubik369 Thanks for your reply:) I was wondering if you follow the example folder or the iOS instruction. Seems like there is discrepancy between them.

ps: Android works great, be able to open the app immediately when the user selects it in the share menu, but iOS has the issue.

asadd-irfan commented 2 years ago

@kubik369 hi sir, kindly explain i am trying to send extraData in my app from share by using continueInApp in IOS but i can't receive that data in my app. can u please help. @lukelu0520 @gilsonviana-modus @davidsalib

ShareMenuReactView.data().then(item => {
      ShareMenuReactView.continueInApp({
        continueInApp: true,
        data: item.data[0].data,
        mimeType: item.data[0].mimeType,
      });

    });
lac96it commented 1 year ago

@asadd-irfan same problem. Are you have solution for this?

roman-myshchyshyn commented 1 year ago

@kubik369 have you solved it for you, to skip dialog on iOS ?

kubik369 commented 1 year ago

@roman-myshchyshyn I wasn't able to get rid of the modal popping up for a split second (although I think it would be possible with some objective C/Swift skills). We have it currently set up so that continueInApp gets called immediately and that goes into the app :)

teja2495 commented 1 year ago

@kubik369 Can you please share the steps on how you did that? Thanks!

walshie4 commented 4 days ago

@teja2495 In case you still need it you can call ShareMenuReactView.continueInApp(); inside a useEffect with no dependencies so it happens on first render