// // 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) { #if DEBUG #else //TestFlight.TakeOff ("ac104b5ca4df6cdfc5b9c63eb448f2af_NjMyMDYyMDEyLTAyLTE2IDExOjE5OjQ4LjkxMjI3Mw"); #endif #region Notification // check for a notification if (options != null) { /* // check for a local notification if (options.ContainsKey (UIApplication.LaunchOptionsLocalNotificationKey)) { UILocalNotification localNotification = options [UIApplication.LaunchOptionsLocalNotificationKey] as UILocalNotification; if (localNotification != null) { new UIAlertView (localNotification.AlertAction, localNotification.AlertBody, null, "OK", null).Show (); // reset our badge UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0; } } */ // check for a remote notification if (options.ContainsKey (UIApplication.LaunchOptionsRemoteNotificationKey)) { NSDictionary remoteNotification = options [UIApplication.LaunchOptionsRemoteNotificationKey] as NSDictionary; if (remoteNotification != null) { //new UIAlertView(""Notification, remoteNotification["alert"], null, "OK", null).Show(); //PushNotifications.ProcessNotification (options, true); UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0; } } } //PushNotifications.Subscribe (); #endregion this.window = new UIWindow (UIScreen.MainScreen.Bounds); //---- instantiate a new home screen RootViewController rootController = new RootViewController (); //---- instantiate a new navigation controller this.rootNavigationController = new BaseNavigationController (rootController); //---- add the home screen to the navigation controller // (it'll be the top most screen) //this.rootNavigationController.PushViewController (rootController, false); //---- set the root view controller on the window. the nav // controller will handle the rest this.window.RootViewController = this.rootNavigationController; this.window.MakeKeyAndVisible (); //showSplash (rootController); showSplashScreen (); return true; }
public void showSplash (RootViewController rootController) { var splashView = new UIImageView (UIScreen.MainScreen.Bounds);// (new RectangleF (0f, 0f, 320f, 480f)); splashView.Image = UIImage.FromFile ("Default.png"); UIViewController modalViewController = new UIViewController (); modalViewController.View = splashView; modalViewController.ModalTransitionStyle = UIModalTransitionStyle.FlipHorizontal; rootController.PresentViewController (modalViewController, false, null); NSTimer.CreateScheduledTimer (new TimeSpan (0, 0, 3), delegate { modalViewController.DismissViewController(true, null); UIApplication.SharedApplication.SetStatusBarHidden (false, false); }); }