当前位置: 首页>>代码示例>>C#>>正文


C# FBResult类代码示例

本文整理汇总了C#中FBResult的典型用法代码示例。如果您正苦于以下问题:C# FBResult类的具体用法?C# FBResult怎么用?C# FBResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FBResult类属于命名空间,在下文中一共展示了FBResult类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoginCallback

 //Check Login
 void LoginCallback(FBResult result)
 {
     if (!FB.IsLoggedIn)
     {
         gamestate.isfacebookclick = false;
         //FB.Login ("public_profile,email,user_friends", LoginCallback);
         //Screen.orientation = ScreenOrientation.LandscapeRight;
         //gamestate.stategame = GameState.StateGame.Reborn;
     }
     else
     {
         //gamestate.stategame = GameState.StateGame.Reborn;
         showNotification();
         StartCoroutine("ParseLogin");
         //Screen.orientation = ScreenOrientation.LandscapeRight;
         /*FB.Feed(
             link: "http://s1.anh.im/2015/05/01/icon17e07.png",
             linkName: "Test thôi mà",
             linkCaption: "Test tí cho vui",
             linkDescription: "Test nào",
             picture: "http://s1.anh.im/2015/05/01/icon17e07.png",
             callback :SharedCallback
             );*/
     }
 }
开发者ID:CTcorp,项目名称:GameMobileZone-Ghostrunner,代码行数:26,代码来源:LoginIcon.cs

示例2: FBLoginCallback

	void FBLoginCallback(FBResult result) {                                                                                          
		FbDebug.Log("LoginCallback");                                                          
		if (FB.IsLoggedIn) {                                                                                      
			Debug.LogWarning("Logged in. ID: " + FB.UserId);
			StartCoroutine(FBTakeScreenshot());
		}                                                                                      
	}
开发者ID:coderlazy,项目名称:kloserbsb,代码行数:7,代码来源:BtnSocial.cs

示例3: FBAPICallback

    private void FBAPICallback(FBResult result)
    {
        if (!String.IsNullOrEmpty(result.Error)) {
            Debug.Log ("FBAPICallback: Error getting user info: + "+ result.Error);
            // Log the user out, the error could be due to an OAuth exception
            ParseFBLogout();
        } else {
            // Got user profile info
            var resultObject = Json.Deserialize(result.Text) as Dictionary<string, object>;
            var userProfile = new Dictionary<string, string>();

            userProfile["facebookId"] = getDataValueForKey(resultObject, "id");
            userProfile["name"] = getDataValueForKey(resultObject, "name");
            object location;
            if (resultObject.TryGetValue("location", out location)) {
                userProfile["location"] = (string)(((Dictionary<string, object>)location)["name"]);
            }
            userProfile["gender"] = getDataValueForKey(resultObject, "gender");
            userProfile["birthday"] = getDataValueForKey(resultObject, "birthday");
            userProfile["relationship"] = getDataValueForKey(resultObject, "relationship_status");
            if (userProfile["facebookId"] != "") {
                userProfile["pictureURL"] = "https://graph.facebook.com/" + userProfile["facebookId"] + "/picture?type=large&return_ssl_resources=1";
            }

            var emptyValueKeys = userProfile
                .Where(pair => String.IsNullOrEmpty(pair.Value))
                    .Select(pair => pair.Key).ToList();
            foreach (var key in emptyValueKeys) {
                userProfile.Remove(key);
            }

            StartCoroutine("saveUserProfile", userProfile);
        }
    }
开发者ID:JamesHongBiz333,项目名称:IntegratingFacebookTutorial,代码行数:34,代码来源:MainMenu.cs

示例4: OnFBLoggedIn

	// Called when logged in to Facebook
	private void OnFBLoggedIn(FBResult p_result)
	{
//		Debug.Log(p_result.Text);
		if(string.IsNullOrEmpty(p_result.Error) && FB.IsLoggedIn)
		{
			this.fbLoginButton.SetActive(false);

			JToken resultJToken = JsonTools.ConvertStringToJToken(p_result.Text);
			if(resultJToken != null)
			{
				this.fbToken = (string)resultJToken["access_token"];
				LeanTween.alpha(
					this.goodFacebookLogo.gameObject,
					1f,
					1f)
					.setEase(LeanTweenType.easeInOutSine);

				BubbleGraph.Create((string)resultJToken["user_id"]);
			}
			else
			{
				Debug.LogError("Problem reading Facebook login result JSON");
			}
		}
		else
		{
			LeanTween.alpha(
				this.goodFacebookLogo.gameObject,
				1f,
				0.2f)
				.setEase(LeanTweenType.easeInOutSine)
				.setLoopPingPong(1);
		}
	}
开发者ID:YanivP,项目名称:FriendBubbles,代码行数:35,代码来源:Core.cs

示例5: GetProfileCallback

    void GetProfileCallback(FBResult result)
    {
        if(result.Error != null)
        {
            if (attemptsToLoadProfile < 3)
            {
                //retry the request if an error has occured, probably need to check how many times this fails.
                GetProfile();
                attemptsToLoadProfile++;
            }
            else
            {
                Debug.Log("Failed to GetProfile: " + result.Text);
            }
        }
        else
        {
            try
            {
                var pure = result.Text;

                ProfileData = Util.DeserializeJSONProfile(result.Text);
                var friends = Util.DeserializeJSONFriends(result.Text);

                //Use the Console tab in the Editor to view this data without using breakpoints
                Debug.Log(GetValueFromPofile("first_name") + " " + GetValueFromPofile("last_name"));

            }
            catch(Exception ex)
            {
                //exceptions are never filled with any data when this fails?
                Debug.Log(ex.Message);
            }
        }
    }
开发者ID:schoolsout,项目名称:Schools-Out,代码行数:35,代码来源:FacebookController.cs

示例6: Callback2

    // FB.api callback for friends
    void Callback2(FBResult result)
    {
        Debug.Log (result.Text);

        IDictionary data = (IDictionary) Json.Deserialize(result.Text);

        IList friends = (IList) data["data"];

        string name;
        string id;

        foreach (IDictionary friend in friends) {

            name = (string)friend["name"];
            id = (string)friend["id"];
            url = (string)((IDictionary)((IDictionary)friend["picture"])["data"])["url"];

            StartCoroutine(getTextureByURL());

            // fetch only one row
            break;
        }

        Debug.Log ("Finished API call.");
    }
开发者ID:scott1028,项目名称:Unity3D_Facebook_Sample,代码行数:26,代码来源:invoke_fb_api.cs

示例7: OnFBAuth

	private void OnFBAuth(FBResult result) {

		SPFacebook.Instance.OnAuthCompleteAction -= OnFBAuth;


		if(SPFacebook.Instance.IsLoggedIn) {

			SPFacebook.Instance.OnPostingCompleteAction += HandleOnPostingCompleteAction;
			SPFacebook.instance.Post(_toId,
			                         _link,
			                         _linkName,
			                         _linkCaption,
			                         _linkDescription,
			                         _picture,
			                         _actionName,
			                         _actionLink,
			                         _reference);

		} else {
			FBResult res =  new FBResult("", "Auth failed");
			FBPostResult postResult =  new FBPostResult(res);

			ActionComplete(postResult);
		}



	}
开发者ID:Tetta,项目名称:Feed-the-Spider,代码行数:28,代码来源:FBPostingTask.cs

示例8: LoginCallback

 void LoginCallback(FBResult result)
 {
     Debug.Log ("logged in!" + FB.UserId);//use this to sync progress etc
     Debug.Log("login result: " + result.Text);
     FB.API("/me?fields=id,first_name,friends.limit(100).fields(first_name,id)", Facebook.HttpMethod.GET, APICallback);
     FB.API(Util.GetPictureURL("me", 128, 128), Facebook.HttpMethod.GET, MyPictureCallback);
 }
开发者ID:keang,项目名称:gimmieunity,代码行数:7,代码来源:Facebookinit.cs

示例9: API

 public static void API(
     string endpoint,
     HttpMethod method,
     FacebookDelegate callback)
 {
     if (method != HttpMethod.GET) throw new NotImplementedException();
     Task.Run(async () =>
     {
         FacebookClient fb = new FacebookClient(_fbSessionClient.CurrentAccessTokenData.AccessToken);
         FBResult fbResult = null;
         try
         {
             var apiCall = await fb.GetTaskAsync(endpoint, null);
             if (apiCall != null)
             {
                 fbResult = new FBResult();
                 fbResult.Text = apiCall.ToString();
                 fbResult.Json = apiCall as JsonObject;
             }
         }
         catch (Exception ex)
         {
             fbResult = new FBResult();
             fbResult.Error = ex.Message;
         }
         if (callback != null)
         {
             Utils.RunOnUnityAppThread(() => { callback(fbResult); });
         }
     });
 }
开发者ID:JeffreyKimani,项目名称:unityplugins,代码行数:31,代码来源:FB.cs

示例10: APICallback

    private void APICallback(FBResult result)
    {
        
        textoui.text = result.Text;

        Debug.Log(FB.UserId);
    }
开发者ID:alusor,项目名称:TecnoRacing,代码行数:7,代码来源:FBGet.cs

示例11: FBAPICallback

    private void FBAPICallback(FBResult result)
    {
        if (!String.IsNullOrEmpty(result.Error)) {
            // Handle error
        } else {
            // Got user profile info
            var resultObject = Json.Deserialize(result.Text) as Dictionary<string, object>;
            var userProfile = new Dictionary<string, string>();

            userProfile["facebookId"] = getDataValueForKey(resultObject, "id");
            userProfile["name"] = getDataValueForKey(resultObject, "name");
            object location;
            if (resultObject.TryGetValue("location", out location)) {
                userProfile["location"] = (string)(((Dictionary<string, object>)location)["name"]);
            }
            userProfile["locale"] = getDataValueForKey(resultObject, "locale");
            userProfile["gender"] = getDataValueForKey(resultObject, "gender");
            //userProfile["birthday"] = getDataValueForKey(resultObject, "birthday");
            //userProfile["relationship"] = getDataValueForKey(resultObject, "relationship_status");
            if (userProfile["facebookId"] != "") {
                userProfile["pictureURL"] =
                    "https://graph.facebook.com/" + userProfile["facebookId"] + "/picture?type=large&width=128&height=128&return_ssl_resources=1";
            }
            //userProfile["score"] = "555555";
            StartCoroutine("saveUserData", userProfile);
        }
    }
开发者ID:CTcorp,项目名称:GameMobileZone-Ghostrunner,代码行数:27,代码来源:LoginIcon.cs

示例12: LoginCallback

 void LoginCallback(FBResult result)
 {
     if (FB.IsLoggedIn)
     {
         PostScore(PlayerPrefs.GetInt("Last Score"));
     }
 }
开发者ID:jieverson,项目名称:PixelRoad,代码行数:7,代码来源:FacebookLogin.cs

示例13: InvitedCallback

    void InvitedCallback(FBResult result)
    {
        Debug.Log (result.Text);
        //Screen.orientation = ScreenOrientation.LandscapeLeft;
        if(result.Error != null)
        {
            //Debug.LogError("OnActionShared: Error: " + result.Error);
        }

        if (result == null || result.Error != null)
        {
            //Do something request failed

        }
        else
        {
            var responseObject = Facebook.MiniJSON.Json.Deserialize(result.Text) as System.Collections.Generic.Dictionary<string, object>;
            object obj = 0;
            if (responseObject == null || responseObject.Count <= 0 || responseObject.TryGetValue("cancelled", out obj))
            {
                //Debug.LogWarning("Request cancelled");
                //Do something when user cancelled
            }
            else if (responseObject.TryGetValue("id", out obj) || responseObject.TryGetValue("post_id", out obj))
            {
                //Debug.LogWarning("Request Send");
                //Do something it is succeeded
            }
        }
    }
开发者ID:CTcorp,项目名称:GameMobileZone-Ghostrunner,代码行数:30,代码来源:ShareIcon.cs

示例14: OnFacebookLogin

	void OnFacebookLogin(FBResult result)
	{
		if (FB.IsLoggedIn) 
		{
			// It worked
			Debug.Log("Facebook auth success");

			// Now we login using Braincloud
			BrainCloudWrapper.GetBC().AuthenticationService.AuthenticateFacebook(
				FB.UserId, 
				FB.AccessToken, 
				true, 
				OnBraincloudAuthenticateFacebookSuccess, 
				OnBraincloudAuthenticateFacebookFailed);

			// Meanwhile, we will fetch info about our player, to get the profile pic and name
			FB.API("/me?fields=name,picture", Facebook.HttpMethod.GET, OnFacebookMe);
		}
		else
		{
			// It failed
			Debug.LogError("Facebook auth failed");
			m_isConnecting = false;
			spinner.gameObject.SetActive(false); // Hide spinner
		}
	}
开发者ID:Vince-Bitheads,项目名称:UnityExamples,代码行数:26,代码来源:FacebookLogin.cs

示例15: handleResult

 protected void handleResult(FBResult result)
 {
     lastResponseTexture = null;
     // Some platforms return the empty string instead of null.
     if (!String.IsNullOrEmpty(result.Error))
     {
         status = "Error - Check log for details";
         lastResponse = "Error Response:\n" + result.Error;
         LogView.AddLog(result.Error);
     } else if (!String.IsNullOrEmpty(result.Text))
     {
         status = "Success - Check log for details";
         lastResponse = "Success Response:\n" + result.Text;
         LogView.AddLog(result.Text);
     } else if (result.Texture != null)
     {
         status = "Success - Check log for details";
         lastResponseTexture = result.Texture;
         lastResponse = "Success Response: texture\n";
         LogView.AddLog("Success - Failed to display details since response was a texture");
     } else
     {
         lastResponse = "Empty Response\n";
         LogView.AddLog(lastResponse);
     }
 }
开发者ID:dth138,项目名称:friendsmash-unity,代码行数:26,代码来源:MenuBase.cs


注:本文中的FBResult类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。