Closed dayliff-svr closed 3 years ago
You can try adding the following to NativeShare.mm:
extern "C" void _Dismiss_View()
{
UIViewController *view = [UnityGetGLViewController() presentedViewController];
if( view != nil )
[view dismissViewControllerAnimated:NO completion:nil];
}
Then calling it with:
#if !UNITY_EDITOR && UNITY_IOS
[System.Runtime.InteropServices.DllImport( "__Internal" )]
private static extern void _Dismiss_View();
#endif
void Blabla()
{
#if !UNITY_EDITOR && UNITY_IOS
_Dismiss_View();
#endif
}
If that doesn't work, I'm out of ideas.
BAM! Exactly what I was looking for. Thank you for your help.
You are welcome. Happy to hear that it worked 🕺
The issue: When sharing videos on iOS the share dialog get stuck, and you can't go back to the experience. Either the app becomes non-clickable with black bars around the edges, or the uploading screen displays and doesn't go away. The only way to recover from this state is to close and reopen the app.
I know Instagram is really picky with what videos you can upload, so I'm not concerned that videos can't be shared all the time. I'm trying to add a way to force hide the share dialog. I was planning on hooking it up to the OnApplicationFocus method within my application.