-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathAppDelegate.cs
More file actions
77 lines (60 loc) · 2.54 KB
/
Copy pathAppDelegate.cs
File metadata and controls
77 lines (60 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;
using System.Runtime.InteropServices;
using ObjCRuntime;
namespace FamilyManager
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register( "AppDelegate" )]
public partial class AppDelegate : UIApplicationDelegate
{
// class-level declarations
UIWindow window;
CoreViewController CoreViewController { get; set; }
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching( UIApplication app, NSDictionary options )
{
// create a new window instance based on the screen size
window = new UIWindow( UIScreen.MainScreen.Bounds );
// If you have defined a root view controller, set it here:
CoreViewController = new CoreViewController();
window.RootViewController = CoreViewController;
// make the window visible
window.MakeKeyAndVisible( );
// start up the delegate and actual location service
Location.Location.Instance.OnRegionEnteredDelegate = CoreViewController.RegionEntered;
Location.Location.Instance.Create( null );
return true;
}
public override void OnActivated(UIApplication application)
{
Rock.Mobile.Util.Debug.WriteLine("OnActivated called, App is active.");
CoreViewController.OnActivated( );
}
public override void WillEnterForeground(UIApplication application)
{
Rock.Mobile.Util.Debug.WriteLine("App will enter foreground");
Location.Location.Instance.EnterForeground( null );
}
public override void OnResignActivation(UIApplication application)
{
CoreViewController.OnResignActivation( );
}
public override void DidEnterBackground(UIApplication application)
{
CoreViewController.DidEnterBackground( );
Location.Location.Instance.EnterBackground( null );
}
}
}