capacitor-plugins
capacitor-plugins copied to clipboard
Share plugin cannot call Share.share more then one time
Bug Report
Plugin(s)
@capacitor/share: 1.0.3
Capacitor Version
@capacitor/cli: 3.1.1 @capacitor/core: 3.1.1 @capacitor/android: 3.1.1 @capacitor/ios: 3.1.1
Platform(s)
android
Current Behavior
While calling Share.share for the first time it will work properly, but if I will try to run the share function again i will get an error: (using the chrome://inspect/#devices -> inspect -> console) Error: Can't share while sharing is in progress Error: Can't share while sharing is in progress
Expected Behavior
Be able to share more then one time
Other Technical Details
After digging up in the SharePlugin.java file i noticed that the activityResult callback is never called so the varriable isPresnteing will always be true after calling the share function for the first time
Additional Context
What’s your android version?
@jcesarmobile A physical device running android 10
which option/app are you choosing for sharing?
It happens when i press the cancel button and when i try to share with whatsapp, but those are the only two methods i checked...
After upgrading my android version to 11 it started working as expected.
I'll try to get an Android 10 device to test, it's the only one I don't have at the moment 😢
It happens to us also. Any progress?
I'm also seeing this, but I'm using Android 11.
Edit: it seems to be crucial to actually wait for the returned Promise
to be resolved. After changing my code to do that, it works fine here.
FWIW this mostly needs a documentation update I guess. I also noticed that just await
ing isn't cutting it, is this possibly optimized away?
Waiting for promise dont work for me, any news ?
any updates on this bug?
I encountered this issue, but I found that it was caused by an outdated version of the Facebook connect plugin (ionic-native/facebook
+ cordova-plugin-facebook-connect
) somehow blocking/absorbing all the ActivityResult
s. For me, it was also causing issues with <input type="file">
and other things that rely on opening other activities.
Upgrading the plugin to latest seems to have fixed it for me.
any updates on how to solve it?
share popup should occur only if a specific button is clicked in capacitor.In my app once I click share button to share file, then again If I leave that screen and again start from home screen , it is showing me share popup even before clicking the share button?Is there any way to close this popup from the background ?
Closing since I can't reproduce and some users say it's resolved. If somebody is still facing the same problem, create a new issue and provide a sample app where the issue can be reproduced. Make sure you are using await on the share call and don't call it again until the first one resolved.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.