Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
		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;
		}