error CS0246: The type or namespace name `FBResult' could not be found
Dear unity devs,
I am implementing facebook authentication with photon networking, I had problems with keytool and openssl but those are solved :)
The next problem is I couldn't find any sollution on the web for this problem: error CS0246: The type or namespace name `FBResult' could not be found
I am using the script Photon has on their website. https://doc.photonengine.com/en/pun/current/tutorials/pun-and-facebook-custom-authentication void Awake() { FB.Init(SetInit, OnHideUnity); }
private void SetInit()
{
enabled = true;
if (FB.IsLoggedIn)
{
Debug.Log("SetInit()");
OnLoggedIn();
}
}
private void OnHideUnity(bool isGameShown)
{
Debug.Log("OnHideUnity()");
}
void LoginCallback(FBResult result)
{
if (FB.IsLoggedIn)
{
OnLoggedIn();
}
}
Answer by phil_me_up · Feb 24, 2016 at 03:07 PM
FBResult has been depreciated since FacebookSDK 7.1 https://developers.facebook.com/docs/unity/change-log
You'll need to convert these to the correct type dependent upon the callback. For a login callback, you'll want:
void LoginCallback(ILoginResult result)
{
...
}
Answer by rafaelzuckerberg · Sep 25, 2016 at 07:26 AM
I need for help you one more thing please the method FB.API(... ,..., ...) ? to name and picture msng error : "No overload for method 'API' takes '2' or '3' arguments" ................. why ?
public void Login(){
FB.LogInWithReadPermissions (callback: OnLogin);
}
public void OnLogin(ILoginResult result){
if (FB.IsLoggedIn) {
***** here 3 parameters
FB.API("/me?fields=first_name",HttpMethod.POST,DisplayUserName);
FB.API("/me/picture?type=square&height=128&width=128",HttpMethod.GET);
} else {
Debug.Log ("Canceled Login");
}
}
void DealWithProfilePictures(ILoginResult result){
if(result.Error != null){
Debug.Log ("Problem with getting profile picture");
*** 2 parameters
//FB.API("/me/picture?type=square&height=128&width=128",DealWithProfilePictures);
//pictureUser.sprite = result.ResultDictionary[];
return;
}
}
void DisplayUserName(ILoginResult result){
if(result.Error != null){
nameText.text = "Welcome " + result.ResultDictionary ["first_name"];
return;
}else{
Debug.Log (result.Error);
}
}
Your answer
![](https://koobas.hobune.stream/wayback/20220612065351im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
firebase - Facebook authentication invalid access_token error code 43 1 Answer
Unity login system without Photon Custom Auth 0 Answers
Facebook SDK - iOS - Doesn't return user data 1 Answer
How to do Firebase Facebook Authentication? 1 Answer
how can i use facebook authentication for pc games? 0 Answers