Login problems with Facebook SDK for Unity

I want to allow logging in and inviting players over Facebook, but I’m having a problem.


I use Unity 5.4.2f2 and Facebook SDK for Unity 7.9.0. This is my code:

voidAwake(){
FB.Init(SetInit,OnHideUnity);}

voidSetInit(){Debug.Log(“FB Init Done”);

if(FB.IsLoggedIn){Debug.Log(“FB is logged in”);}else{FBlogin();

}}

voidOnHideUnity(bool isGameShown){if(!isGameShown){Time.timeScale =0;}else{Time.timeScale =1;}}

publicvoidFBlogin(){List permissions =newList();
permissions.Add(“public_profile”);

FB.LogInWithReadPermissions(permissions,AuthCallBack);}

voidAuthCallBack(IResult result){if(FB.IsLoggedIn){Debug.Log(“FB login worked”);
FB.AppRequest(
message:“Come and Play This Game!”,
title:“My Game Invitation For Facebook Friend”);}else{Debug.Log(“FB fail”);}}
}
Why am I getting this error, and how do I fix it?

What error are you getting?

The screenshot you posted is what the Facebook login dialog looks like when playing inside the Unity editor.

What was the result on an actual device?