|
| 1 | +using Foundation; |
| 2 | +using UIKit; |
| 3 | +using System; |
| 4 | + |
| 5 | +namespace iOSClient |
| 6 | +{ |
| 7 | + // The UIApplicationDelegate for the application. This class is responsible for launching the |
| 8 | + // User Interface of the application, as well as listening (and optionally responding) to application events from iOS. |
| 9 | + [Register ("AppDelegate")] |
| 10 | + public class AppDelegate : UIApplicationDelegate |
| 11 | + { |
| 12 | + // class-level declarations |
| 13 | + |
| 14 | + public override UIWindow Window { |
| 15 | + get; |
| 16 | + set; |
| 17 | + } |
| 18 | + |
| 19 | + public static Action<string> CallbackHandler { get; set;} |
| 20 | + |
| 21 | + public override bool OpenUrl (UIApplication application, NSUrl url, string sourceApplication, NSObject annotation) |
| 22 | + { |
| 23 | + CallbackHandler (url.AbsoluteString); |
| 24 | + CallbackHandler = null; |
| 25 | + |
| 26 | + return true; |
| 27 | + } |
| 28 | + |
| 29 | + public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions) |
| 30 | + { |
| 31 | + // Override point for customization after application launch. |
| 32 | + // If not required for your application you can safely delete this method |
| 33 | + |
| 34 | + return true; |
| 35 | + } |
| 36 | + |
| 37 | + public override void OnResignActivation (UIApplication application) |
| 38 | + { |
| 39 | + // Invoked when the application is about to move from active to inactive state. |
| 40 | + // This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) |
| 41 | + // or when the user quits the application and it begins the transition to the background state. |
| 42 | + // Games should use this method to pause the game. |
| 43 | + } |
| 44 | + |
| 45 | + public override void DidEnterBackground (UIApplication application) |
| 46 | + { |
| 47 | + // Use this method to release shared resources, save user data, invalidate timers and store the application state. |
| 48 | + // If your application supports background exection this method is called instead of WillTerminate when the user quits. |
| 49 | + } |
| 50 | + |
| 51 | + public override void WillEnterForeground (UIApplication application) |
| 52 | + { |
| 53 | + // Called as part of the transiton from background to active state. |
| 54 | + // Here you can undo many of the changes made on entering the background. |
| 55 | + } |
| 56 | + |
| 57 | + public override void OnActivated (UIApplication application) |
| 58 | + { |
| 59 | + // Restart any tasks that were paused (or not yet started) while the application was inactive. |
| 60 | + // If the application was previously in the background, optionally refresh the user interface. |
| 61 | + } |
| 62 | + |
| 63 | + public override void WillTerminate (UIApplication application) |
| 64 | + { |
| 65 | + // Called when the application is about to terminate. Save data, if needed. See also DidEnterBackground. |
| 66 | + } |
| 67 | + } |
| 68 | +} |
| 69 | + |
| 70 | + |
0 commit comments