Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initiating the purchase flow intercepts onActivityResult calls from Capacitor plugins #1549

Open
masimplo opened this issue Mar 20, 2024 · 0 comments

Comments

@masimplo
Copy link
Contributor

I am using this plugin (version 13.10.1) in a capacitor project (version 5.7.3) along other capacitor plugins. For this issue report I will focus on the official Share plugin that utilizes the startActivityForResult and onActivityResult mechanism (but the same is happening to many others).

Observed behavior

Issue is that after initiating the purchase flow the plugin intercepts any onActivityResult calls from other plugins for their first call.

So when I initiate the purchase flow and dismiss the payment sheet, either by buying a product or closing it (the onActivityResult is not called), and then calling a capacitor plugin (the Share plugin in this case) that utilizes startActivityForResult and onActivityResult, the capacitor plugin never gets to return its payload back to the app as this plugin has set the activityResultCallback property to capacitor bridge.java and thus captures the result.

Here is a video demonstrating the issue and the flow:
https://www.youtube.com/watch?v=SRxTy1jfD84

Notice that Share plugin onActivityResult works as expected at first, but then after invoking the purchase flow of this plugin, the share plugin onActivityResult is not invoked anymore.

Expected behavior

System Info

Output of cordova info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant