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

android Chooser SharePayload Commit Task blocks indefinitely when user closes without selection #122

Closed teleportal-andrew closed 3 years ago

teleportal-andrew commented 3 years ago

On Android When the Chooser is launched from SharePayload.Commit() if the user closes the activity without making a selection an await on SharePlayload.Commit() will block indefinitely

presumably https://github.com/natsuite/NatShare/blob/36ab10097f6dbf7968cd517b5b1aee9b24cd4df1/Android/NatShare/src/main/java/api/natsuite/natshare/SharePayload.java#L108 callback is never getting called because no choice is made

it would be convenient if SharePayload.Commit() also detected if the chooser activity was closed without a choice, and returned with no selection in this case

observed in Android 11

olokobayusuf commented 3 years ago

it would be convenient if SharePayload.Commit() also detected if the chooser activity was closed without a choice, and returned with no selection in this case

This is bad design from the Android folks. Android will not tell you when the activity is closed without a choice. See this and this.