void SetupUI() { var sessionDelegate = new SessionDelegate(this); facebook = new Facebook(AppId, sessionDelegate); var defaults = NSUserDefaults.StandardUserDefaults; if (defaults ["FBAccessTokenKey"] != null && defaults ["FBExpirationDateKey"] != null) { facebook.AccessToken = defaults ["FBAccessTokenKey"] as NSString; facebook.ExpirationDate = defaults ["FBExpirationDateKey"] as NSDate; } dvc = new DialogViewController(null); nav = new UINavigationController(dvc); if (facebook.IsSessionValid) { ShowLoggedIn(); } else { ShowLoggedOut(); } window = new UIWindow(UIScreen.MainScreen.Bounds); window.MakeKeyAndVisible(); window.RootViewController = nav; }
void SetupUI () { var sessionDelegate = new SessionDelegate (this); facebook = new Facebook (AppId, sessionDelegate); var defaults = NSUserDefaults.StandardUserDefaults; if (defaults ["FBAccessTokenKey"] != null && defaults ["FBExpirationDateKey"] != null){ facebook.AccessToken = defaults ["FBAccessTokenKey"] as NSString; facebook.ExpirationDate = defaults ["FBExpirationDateKey"] as NSDate; } dvc = new DialogViewController (null); nav = new UINavigationController (dvc); if (facebook.IsSessionValid) ShowLoggedIn (); else ShowLoggedOut (); window = new UIWindow (UIScreen.MainScreen.Bounds); window.MakeKeyAndVisible (); window.RootViewController = nav; }