コード例 #1
0
    void CallbackInvitableFriends(IResult result)
    {
        if (!string.IsNullOrEmpty(result.Error))
        {
            Debug.Log("## CallbackInvitableFriends #Error = " + result.Error);
            return;
        }

#if UNITY_EDITOR
        PlayerPrefHelper.SetFBInvitableFriendsResult(result.RawResult);
#endif
        string strResult = result.RawResult;
        strResult = strResult.Replace(@"\/", @"/");
        Debug.Log("## CallbackInvitableFriends >> strResult = " + strResult);

        _FBInvitableFriends = new FBInvitableFriendsVO(strResult);
        //CLog.Log2(TAG, "CallbackInvitableFriends >> after parse = " + _invitableFriendsVO.DebugString());
    }
コード例 #2
0
    IEnumerator LoadInvitableFriends(System.Action complete)
    {
        yield return(new WaitForSeconds(1.0f));

        string meQueryString = "/me?fields=id,name,invitable_friends.limit(50).fields(name,id,picture.width(100).height(100))";

        //FB.API(meQueryString, HttpMethod.GET, APICallback);
        FB.API("me/invitable_friends?fields=id,name,picture.width(300)", HttpMethod.GET, (result) => {
            if (!string.IsNullOrEmpty(result.Error))
            {
                Debug.Log("## LoadInvitableFriends #Error = " + result.Error);

                if (complete != null)
                {
                    complete();
                }
                return;
            }

            if (result.Cancelled)
            {
                if (complete != null)
                {
                    complete();
                }
                return;
            }

#if UNITY_EDITOR
            PlayerPrefHelper.SetFBInvitableFriendsResult(result.RawResult);
#endif
            string strResult = result.RawResult;
            strResult        = strResult.Replace(@"\/", @"/");
            Debug.Log("## CallbackInvitableFriends >> strResult = " + strResult);

            _FBInvitableFriends = new FBInvitableFriendsVO(strResult);
            //CLog.Log2(TAG, "CallbackInvitableFriends >> after parse = " + _invitableFriendsVO.DebugString());

            if (complete != null)
            {
                complete();
            }
        });
    }