natshare icon indicating copy to clipboard operation
natshare copied to clipboard

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

Open mattdw opened this issue 2 years ago • 2 comments

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 avatar Jul 20 '22 21:07 mattdw

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!

mattdw avatar Jul 20 '22 21:07 mattdw

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 avatar Jul 21 '22 16:07 olokobayusuf

This will be fixed in NatShare 1.2.7.

olokobayusuf avatar Sep 26 '22 03:09 olokobayusuf