2019-03-01 10:59:39 +00:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
2019-01-25 09:55:05 +00:00
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-12-29 09:35:37 +00:00
|
|
|
|
2019-07-24 12:49:35 +00:00
|
|
|
using System.Threading.Tasks;
|
2018-12-29 09:35:37 +00:00
|
|
|
using Foundation;
|
2018-12-06 11:00:23 +00:00
|
|
|
using osu.Framework.iOS;
|
|
|
|
using osu.Game;
|
2019-07-24 12:49:35 +00:00
|
|
|
using UIKit;
|
2018-12-06 07:19:09 +00:00
|
|
|
|
|
|
|
namespace osu.iOS
|
|
|
|
{
|
|
|
|
[Register("AppDelegate")]
|
2018-12-06 11:00:23 +00:00
|
|
|
public class AppDelegate : GameAppDelegate
|
2018-12-06 07:19:09 +00:00
|
|
|
{
|
2019-07-24 12:49:35 +00:00
|
|
|
private OsuGameIOS IOSGame;
|
|
|
|
|
|
|
|
protected override Framework.Game CreateGame()
|
|
|
|
{
|
|
|
|
//Save OsuGameIOS for Import
|
|
|
|
IOSGame = new OsuGameIOS();
|
|
|
|
return IOSGame;
|
|
|
|
}
|
|
|
|
|
|
|
|
public override bool OpenUrl(UIApplication application, NSUrl url, string sourceApplication, NSObject annotation)
|
|
|
|
{
|
|
|
|
//Open in Application
|
|
|
|
Task.Run(() => IOSGame.Import(url.Path));
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
2018-12-06 07:19:09 +00:00
|
|
|
}
|
|
|
|
}
|