简体   繁体   English

unity3d 4.3 Facebook SDK登录

[英]unity3d 4.3 facebook SDK login

hi i have unity3d and the latest facebook sdk 嗨,我有unity3d和最新的facebook sdk

i've downloaded the sample project but i got a problem, when i start the project and click login, unity immediately show this images: 我已经下载了示例项目,但遇到问题,当我启动该项目并单击“登录”时,Unity立即显示以下图像:

在此处输入图片说明

which i expecting i've got an error from this part of code in mainmenu.cs 我期望我在mainmenu.cs的这部分代码中遇到错误

if (FB.IsLoggedIn)
    {
        string panelText = "Welcome ";


        if (GameStateManager.Username != null) panelText += GameStateManager.Username + "!";
        else panelText += "Smasher!"; //I GOT THIS ELSE BLOCK !

        if (GameStateManager.UserTexture != null) 
            GUI.DrawTexture( (new Rect(8,10, 150, 150)), GameStateManager.UserTexture);


        GUI.Label( (new Rect(179 , 11, 287, 160)), panelText, MenuSkin.GetStyle("text_only"));
    }

which is my gamestatemanager.username is null... i just want to know why my gamestatemanager.username is null, how to get some data to fill that.. i've followed step to fill gamestatemanager.username in this link where's my error btw ? 这是我gamestatemanager.username是空...我只是想知道为什么我的gamestatemanager.username为空,如何获得一些数据来填补这个..我已经遵循的步骤在此填写gamestatemanager.username 链接这里是我的错误顺便说一句? anyone can help ? 有人可以帮忙吗?

Please see this question. 请参阅此问题。 Unity Facebook SDK Login Always Returns User 0 Access Token abc...z We don't support the editor or desktop yet. Unity Facebook SDK登录始终返回用户0访问令牌abc ... z我们尚不支持编辑器或桌面。 You will have to run on an ios or android device, or publish your app to facebook canvas. 您将必须在ios或android设备上运行,或将您的应用发布到facebook画布。

I think you are having the same problem I am... It seems it has logged you in but returns USerID:0 and Access Token: abcdefghijklmnopqrstuvwxyz 我认为您遇到的是相同的问题...似乎已经登录了您,但返回了USerID:0和访问令牌:abcdefghijklmnopqrstuvwxyz

I think this is a TEST User that is automatically logs in but I can't seem to find out how to turn that off and to actually have it log ME on. 我认为这是一个自动登录的TEST用户,但我似乎无法找出如何关闭它并实际将其登录的方法。

Is your APP in Sandbox mode? 您的APP是否处于沙盒模式? I tried turning my sandbox mode in the facebook app settings off but it didn't seem to effect it... Waiting for an answer on this and my related question... Unity Facebook SDK Login Always Returns User 0 Access Token abc...z 我尝试关闭Facebook应用程序设置中的沙箱模式,但似乎没有影响...等待有关此问题和相关问题的答案... Unity Facebook SDK登录始终返回用户0访问令牌abc。 .z

If you are running this from the EDITOR then the reason is the EDITOR does not actually log you in. 如果您是从EDITOR运行此程序,则原因是EDITOR实际上并未登录。

If you are running from the device...I am still working on that one (also getting the same result you are) 如果您正在从设备上运行...我仍在使用该设备(也得到了与您相同的结果)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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