コード例 #1
0
        /// <summary>
        /// Retrieves the user's Facebook, id, name and profile picture
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="state"></param>
        /// <returns>transaction id - cancelable via Community.Async_Cancel()</returns>
        public static int GetUserInfo(GetUserInfoCompleteDelegate callback, object state)
        {
            GetUserInfoState async = new GetUserInfoState();

            async.callback = callback;
            async.state    = state;

            return(Community.Async_GetFacebookUser(KoduFacebookId, GetUserInfoComplete, async));
        }
コード例 #2
0
        static void GetUserInfoComplete(AsyncResult ar)
        {
            AsyncResult_GetFacebookUser result = (AsyncResult_GetFacebookUser)ar;

            GetUserInfoState async = (GetUserInfoState)result.Param;

            if (result.FacebookResultCode == FacebookResultCode.Success && result.FacebookUser != null)
            {
                user.Id   = result.FacebookUser.Id;
                user.Name = result.FacebookUser.Name;
            }

            if (async.callback != null)
            {
                async.callback(result.Success, result.FacebookResultCode, user, async.state);
            }
        }