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

Save image from system share dialogue doesn't work #73

Closed nicloay closed 4 years ago

nicloay commented 4 years ago

Environment

iOS version: 13.3 (on iPad 7th gen) unity 2017.4.31 plugin version 1.2.1

Info

With standard code

    private void DoShareImage()
    {
        using (var payload = new SharePayload(null, OnShareDone))
        {
            payload.AddImage(GetSelectedTexture());
        }
        Debug.Log(">>> 1");
    }

    private void OnShareDone()
    {
        Debug.Log(">>> 2");
    }

Most of the system action works (share in facebook, send by email, etc...) But save to device do not unfreeze unity (Popup disapear, but unity probably don't receive signal about that, so Debug.Log(2) is never called). The image by the way is stored to the gallery anyway.

here is a log from device

>>> 1
2020-01-07 07:03:20.423079+0100 appname[1368:1033188] [ShareSheet] connection invalidated

If comment UnityPause(false|true) in the NSSharePayload.m - the app is obviously not freeze/unfreeze and save works as expected (not a solution, but just to prove that dispatch_async is not called).

Similar symtoms as here

olokobayusuf commented 4 years ago

The fix here is to not pause Unity Engine.

olokobayusuf commented 4 years ago

1a5381afc00ceb3028343daad96d174997f20512