简体   繁体   中英

Is FB.IsLoggedIn delay after FB.Init?

I have some problem about FB sessions on Facebook Unity SDK .

FB.IsLoggendIn return false every time that make me login every time when app launching. Like below this-

void MethodA()
{
   Debug.Log(FB.IsLoggendIn);
}

FB.Init(MethodA);

But if I waiting more second and I Debug it again. It's return me TRUE. I don't know what happen about this. Delay for get Token? Session or something and how to solve this problem?

This problem has been solved now with this fix.

For iOS, In IOSFacebook.cs

private void OnInitComplete(string msg)
{
    externalInitDelegate(); // move this line
    if(msg != null && msg.Length > 0)
    {
        OnLogin (msg);
    }
    externalInitDelegate(); // to this line
}

For Android, In AndroidFacebook.cs

public void OnInitComplete(string message)
{
    OnLoginComplete(message); // to this line
    if (this.onInitComplete != null)
    {
        this.onInitComplete();
    }
    OnLoginComplete(message); // move this line
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM