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

iOS Permissions are not requested. #86

Closed miketalbott closed 4 years ago

miketalbott commented 4 years ago

On the latest branch (1.2.2 with the bridge-fix) iOS isn't asking for media permission before saving or sharing, resulting in nothing happening. I reverted back to 1.2.1 and it started asking for media permission again. heres and example of my code:

In 1.2.2 (Doesn't work on iOS):

if (await new SavePayload(Application.productName)
    .AddMedia(videoPath)
    .Commit())
    onSuccess?.Invoke();
else
    onFailed?.Invoke();

In 1.2.1 (Does work in iOS):

using (var payload = new SavePayload(Application.productName, () => onSuccess?.Invoke()))
{
    payload.AddMedia(videoPath);
}
miketalbott commented 4 years ago

I just made a build with the Tests scene using the unmodified ShareTest.cs. xCode log shows:

NatSuite.Tests.ShareTest:.ctor() System.Threading.ContextCallback:Invoke(Object) System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean) System.Runtime.CompilerServices.MoveNextRunner:Run() System.Action:Invoke() System.Threading.SendOrPostCallback:Invoke(Object) UnityEngine.UnitySynchronizationContext:Exec() UnityEngine.UnitySynchronizationContext:Exec()

that's the last thing logged and nothing happens in app. (ie. no share sheet appears).

miketalbott commented 4 years ago

Maybe this issue can be disregarded. I haven't been able to recreate it on the latest version.

olokobayusuf commented 4 years ago

Sounds good.