Merge branch 'master' into update-veldrid-spirv-on-ios

This commit is contained in:
Dean Herbert
2023-09-16 19:10:27 +09:00
committed by GitHub
31 changed files with 288 additions and 406 deletions

View File

@@ -14,6 +14,7 @@ using osu.Framework.Input.Bindings;
using osu.Framework.IO.Stores;
using osu.Framework.iOS.Graphics.Textures;
using osu.Framework.iOS.Graphics.Video;
using osu.Framework.Logging;
using osu.Framework.Platform;
using osu.Framework.Platform.MacOS;
using UIKit;
@@ -58,15 +59,26 @@ namespace osu.Framework.iOS
public override void OpenUrlExternally(string url)
{
if (!url.CheckIsValidUrl())
if (!url.CheckIsValidUrl()
// App store links
&& !url.StartsWith("itms-apps://", StringComparison.Ordinal)
// Testflight links
&& !url.StartsWith("itms-beta://", StringComparison.Ordinal))
throw new ArgumentException("The provided URL must be one of either http://, https:// or mailto: protocols.", nameof(url));
UIApplication.SharedApplication.InvokeOnMainThread(() =>
try
{
NSUrl nsurl = NSUrl.FromString(url).AsNonNull();
if (UIApplication.SharedApplication.CanOpenUrl(nsurl))
UIApplication.SharedApplication.OpenUrl(nsurl, new NSDictionary(), null);
});
UIApplication.SharedApplication.InvokeOnMainThread(() =>
{
NSUrl nsurl = NSUrl.FromString(url).AsNonNull();
if (UIApplication.SharedApplication.CanOpenUrl(nsurl))
UIApplication.SharedApplication.OpenUrl(nsurl, new NSDictionary(), null);
});
}
catch (Exception ex)
{
Logger.Error(ex, "Unable to open external link.");
}
}
public override IResourceStore<TextureUpload> CreateTextureLoaderStore(IResourceStore<byte[]> underlyingStore)