videokit-ai / natshare

Cross-platform social sharing for Unity Engine.
https://github.com/natmlx/videokit
Apache License 2.0
134 stars 28 forks source link

SharePayload.Commit() never completes if the panel is dismissed (Android) #132

Closed mattdw closed 2 years ago

mattdw commented 2 years ago

On multiple Android devices (but not iOS):

If you pop up the sharing panel with await payload.Commit(), then dismiss it without choosing a sharing action, the task never returns, the await never completes, and the containing task is deadlocked.

On iOS, the task completes as expected, returning a bool.

Unity 2021.3.x, OPPO w/ Android 12 (among others.)

We've found that this plugin: https://github.com/yasirkula/UnityNativeShare doesn't have the same problem, but it returns a three-way enum (Shared, Not Shared, Unknown) – which makes me wonder if it's just an unhandled case on the Android side.

mattdw commented 2 years ago

Unfortunately I'm a bit strapped for time, otherwise I'd try to work up a minimal test case for you – appreciate your work on this!

olokobayusuf commented 2 years ago

Hey @mattdw this is a known issue. Android doesn't report when the user cancels the share action. We will be adding a way to cancel the task, but not in the next release. Gonna keep this issue open till we add the workaround.

olokobayusuf commented 2 years ago

This will be fixed in NatShare 1.2.7.

olokobayusuf commented 2 years ago

Fixed in NatShare 1.3.