mirror of
https://github.com/SK-la/osu-framework.git
synced 2026-03-15 03:20:30 +00:00
Merge branch 'master' into update-veldrid-spirv-on-ios
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user