AxSU3D Android Facebook插件 - "参数app_id是必需的"

时间:2015-01-23 02:39:08

标签: android facebook unity3d

我在Unity项目中使用AxSU3D的Android插件。当我尝试使用Facebook登录方法时,我收到错误消息“#34;参数app_id是必需的"

我在下面发布了我的代码。我已经更换了字符串" fbAppID"与实际ID。这只是我试图使用的插件附带的示例脚本。

任何帮助将不胜感激

using UnityEngine;
using System.Collections;
using AxSAndroidPlugin.Core;
using AxSAndroidPlugin.Social.Facebook;

public class FacebookSample : MonoBehaviour {

public string fbAppID = "YOUR_FACEBOOK_APP_ID_HERE";

public GameObject picture;
//Texture2D tex;

void OnGUI () {

    if(GUI.Button(GUIControls.GetButtonRect(1), "Init" ))
        Facebook.Init(fbAppID);

    if(GUI.Button(GUIControls.GetButtonRect(2), "Login" ))
        Facebook.Login();

    if(GUI.Button(GUIControls.GetButtonRect(3), "IsLoggedIn"))
        Facebook.IsLoggedIn();

    if(GUI.Button(GUIControls.GetButtonRect(4), "User Info")) {
        Facebook.GetUserInfo();
    }

    if(GUI.Button(GUIControls.GetButtonRect(5), "Friends")) {
        Facebook.GetFriendsList();
    }

    if (GUI.Button (GUIControls.GetButtonRect (6), "Load Profile Picture")) {
        Facebook.LoadProfilePicture();
    }

    if (GUI.Button (GUIControls.GetButtonRect (7), "Get Profile Picture")) {
        Texture2D tex = Facebook.GetProfilePicture();
        picture.renderer.material.mainTexture = tex;
    }

    if(GUI.Button(GUIControls.GetButtonRect(8), "Send Request")) {
        Facebook.SendRequest("This Plugin Rocks!");
    }

    if(GUI.Button(GUIControls.GetButtonRect(9), "Post To Timeline")) {
        string name = "AxS Android Plugin";
        string caption = "AxS Android Plugin for Unity";
        string description = "A complete solution to all your Android native needs!";
        string link = "http://www.axsu3d.com/";
        string pictureLink = "http://www.axsu3d.com/DLs/axsu3dLogo.png";
        Facebook.PostToTimeline(name, caption, description, link, pictureLink);
    }

    //Get the user's likes
    if(GUI.Button(GUIControls.GetButtonRect(10), "User Likes")) {
        Facebook.GetUserLikes();
    }

    //Logout of Facebook
    if(GUI.Button(GUIControls.GetButtonRect(11), "Logout" ))
        Facebook.Logout();

    if(GUI.Button(GUIControls.GetButtonRect(12), "Back"))
        Application.LoadLevel("CoreSample");

}

}

1 个答案:

答案 0 :(得分:0)

首先,哇。我没有意识到我帮助过的东西会出现在SO上。

解决方案很简单,真的。你可能没有使用" Merge Manifest"选项。

您可以在" Tools / AxSU3D / Android / Merge Manifest"下找到此选项。这将显示一个窗口,您可以在其中输入您的Facebook应用程序ID。

该选项将创建或合并一个新的AndroidManifest.xml文件,该文件还将包含您的Facebook App ID。

尝试一下。