Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by IronGirl · Feb 07, 2014 at 03:23 AM · androidfacebook

Get Facebook User name with Facebook sdk Unity android

Hi I m developing an Android Game, i can login to facebook and want to return the facebook id and user name and display them via guitext. Thanks for your help

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Swaminathan · Feb 08, 2014 at 07:17 AM 0
Share

@Irongirl Hello , I too facing the same problem, i'm using prime31 social combo plugin.. if u came to know the answer . kindly help me too .. thanks ..

3 Replies

· Add your reply
  • Sort: 
avatar image
7
Best Answer

Answer by Swaminathan · Feb 20, 2014 at 06:27 AM

 using Facebook.minijson;

 FB.API("me?fields=name", Facebook.HttpMethod.GET, UserCallBack);
 public string get_data;
 public string fbname;

 void UserCallBack(FBResult result) {
   if (result.Error != null)
   {                                                                      
      get_data = result.Text;
   }
   else
   {
      get_data = result.Text;
   }
   var dict = Json.Deserialize(get_data) as IDictionary;
   fbname =dict ["name"].ToString();
 }

NOTE : display fbname using GUIText.

add this code to your script where u need username to be fetched, it will definitely help you .. comment your result so i can understand your problem clearly after this.. thank you.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image IronGirl · Feb 28, 2014 at 09:00 AM 0
Share

Thanks Swa$$anonymous$$athan , that works , i can display the username after connecting to facebook in a GUIText.

avatar image Swaminathan · Mar 03, 2014 at 07:11 AM 0
Share

hmm.. nice..

avatar image
0

Answer by pinunity · May 06, 2014 at 07:03 AM

you are a great help

using Facebook.MiniJSON;

please correct, thanks!!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by mohanki · Dec 08, 2017 at 07:17 AM

Typed Callbacks

FBResult has been replaced. Method callbacks are now typed and have distinct result classes. For example: FB.API will return an IGraphResult and FB.Canvas.Pay will return an IPayResult. Refer to the call signature of each method to learn its result class.

Parsing callback results are simplified with the typed callbacks.

 FB.API("/me?fields=first_name", HttpMethod.GET, delegate (IGraphResult result) {
   // Add error handling here
   if (result.ResultDictionary != null) {
     foreach (string key in result.ResultDictionary.Keys) {
       Debug.Log(key + " : " + result.ResultDictionary[key].ToString());
       // first_name : Chris
       // id : 12345678901234567
     }
   }
 });
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

I can see/send invites to non-app user friends on canvas app but not on android/ios 0 Answers

Failed to build an apk after adding facebook SDK to unity3d project 0 Answers

Can't build for Android 0 Answers

Facebook SDK 3.1.2 for Unity - Trouble logging in on Android Devices 1 Answer

How do I correctly install the Facebook SDK plugin? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges