Ejemplo n.º 1
0
 public static void GetLoggedInUserInfo(Action <SA_FB_GetUserResult> callback)
 {
     GraphAPI.GetLoggedInUserInfo(result => {
         CurrentUser = result.User;
         callback(result);
     });
 }
Ejemplo n.º 2
0
 public SA_FB_GetUserResult(IResult graphResult) : base(graphResult)
 {
     if (m_error == null)
     {
         try {
             var JSON = Json.Deserialize(RawResult) as IDictionary;
             m_user = new SA_FB_User(JSON);
         }
         catch (Exception ex) {
             m_error = new SA_Error(5, "Failed to parse user data " + ex.Message);
         }
     }
 }
 public SA_FB_GetProfileImageUrlResult(IResult graphResult) : base(graphResult)
 {
     if (m_error == null)
     {
         try {
             IDictionary JSON = Json.Deserialize(RawResult) as IDictionary;
             var         user = new SA_FB_User(JSON);
             m_url = user.PictureUrl;
         }
         catch (Exception ex) {
             m_error = new SA_Error(5, "Failed to parse user data " + ex.Message);
         }
     }
 }
        public SA_FBGraphFirendsListResult(IGraphResult graphResult) : base(graphResult)
        {
            if (m_error == null)
            {
                try {
                    IDictionary JSON  = Json.Deserialize(RawResult) as IDictionary;
                    IDictionary f     = JSON[FriendsListKey] as IDictionary;
                    IList       flist = f["data"] as IList;


                    for (int i = 0; i < flist.Count; i++)
                    {
                        SA_FB_User user = new SA_FB_User(flist[i] as IDictionary);
                        m_users.Add(user);
                    }
                } catch (System.Exception ex) {
                    m_error = SA_FB_ErrorFactory.GenerateErrorWithCode(SA_FB_ErrorCode.ParsingFailed, ex.Message);
                }
            }
        }
        public SA_FB_GraphInvitableFriendsListResult(IGraphResult graphResult) : base(graphResult)
        {
            if (m_error == null)
            {
                try {
                    IDictionary RAW     = Json.Deserialize(RawResult) as IDictionary;
                    IDictionary friends = RAW[FriendsListKey] as IDictionary;
                    IList       flist   = friends["data"] as IList;

                    for (int i = 0; i < flist.Count; i++)
                    {
                        SA_FB_User user = new SA_FB_User(flist[i] as IDictionary);
                        m_users.Add(user);
                    }

                    ParseResultId(RAW);
                    ParsePaginatedResult(friends);
                } catch (Exception ex) {
                    m_error = new SA_Error(5, "Failed to parse friends data " + ex.Message);
                }
            }
        }
Ejemplo n.º 6
0
 /// <summary>
 /// On Web, this method will log the user out of both your site and Facebook.
 /// On iOS and Android, it will log the user out of your Application.
 /// On all the platforms it will also invalidate any access token that you have for the user that was issued before the logout.
 ///
 /// On Web, you almost certainly should not use this function, which is provided primarily for completeness.
 /// Having a logout control inside a game that executes a Facebook-wide logout will violate users' expectations.
 /// Instead, allow users to control their logged-in status on Facebook itself.
 /// </summary>
 public static void LogOut()
 {
     CurrentUser = null;
     SA_FB_Proxy.LogOut();
 }