Created
February 16, 2015 18:07
-
-
Save BrianJVarley/0cd6feca927cbcfb1def to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Facebook; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows.Navigation; | |
namespace MyoTestv4.Home | |
{ | |
public class UserLoginModel | |
{ | |
private FacebookClient FBClient; | |
private FacebookClient fbC; | |
public string AccessToken { get; set; } | |
public string Name; | |
public string Gender; | |
public string Link; | |
public void initLogin(NavigationEventArgs e) | |
{ | |
if (e.Uri.ToString().StartsWith("http://www.facebook.com/connect/login_success.html")) | |
{ | |
AccessToken = e.Uri.Fragment.Split('&')[0].Replace("#access_token=", ""); | |
FBClient = new FacebookClient(AccessToken); | |
/* | |
WBrowser.Visibility = Visibility.Hidden; | |
TBInfos.Visibility = Visibility.Visible; | |
*/ | |
fbC = FBClient; | |
dynamic me = FBClient.Get("Me"); | |
/* | |
TBInfos.Text = "Name : " + (me.name ?? (object)string.Empty).ToString() + "\n\r" | |
+ "Gender : " + (me.gender ?? (object)string.Empty).ToString() + "\n\r" | |
+ "Link : " + (me.link ?? (object)string.Empty).ToString(); | |
*/ | |
//set profile fields to string variables | |
Name = me.name; | |
Gender = me.gender; | |
Link = me.link; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment