如何使用 Facebook SDK for Unity 和 Vuforia for Android? [英] How to work with Facebook SDK for Unity and Vuforia for Android?

查看:29
本文介绍了如何使用 Facebook SDK for Unity 和 Vuforia for Android?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用这两个插件时遇到问题:在 AndroidManifest.xml 上,它们都需要是android.intent.category.LAUNCHER"

I'm having a problem working with this two plugins together: on the AndroidManifest.xml both of them need to be "android.intent.category.LAUNCHER"

<application android:icon="@drawable/app_icon" android:label="@string/app_name"     android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:debuggable="false">
        <activity     android:name="com.qualcomm.QCARUnityPlayer.QCARPlayerNativeActivity"     android:label="@string/app_name" android:screenOrientation="portrait"     android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientat    ion|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <meta-data android:name="android.app.lib_name" android:value="unity" />
            <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
    </activity>
    <activity android:name="com.unity3d.player.VideoPlayer" android:label="@string/app_name" android:screenOrientation="portrait" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    </activity>
    <activity android:name="com.facebook.LoginActivity" android:screenOrientation="portrait" android:configChanges="keyboardHidden|orientation">
    </activity>
    <activity android:name="com.facebook.unity.FBUnityPlayerActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
        <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
    </activity>
    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value=" 273811112771671" />
</application>

有没有解决这个问题的办法?我认为这很常见.

Is there any solution available for this trouble? I think it's very common.

推荐答案

我们有一个测试版的 SDK v5.0.2 来尝试解决这个问题:https://developers.facebook.com/docs/unity/downloads/

We have a Beta version of v5.0.2 of the SDK to try to address this issue: https://developers.facebook.com/docs/unity/downloads/

基本上我们不赞成要求 FBUnityPlayerActivity 作为主要活动.这应该允许您使用您喜欢的任何主要活动.

Basically we deprecated requiring FBUnityPlayerActivity to be the main activity. This should allow you to use whatever main activity you like.

由于我们正在解决问题,它仍处于测试阶段.如果您的项目中仍有旧版本的 Facebook SDK,请在导入后转到Facebook->编辑设置",然后在Android 构建设置"选项卡中,单击重新生成 Android 清单".那应该用新的 facebook 活动修改它.然后,您应该可以自由修改您的 AndroidManifest.xml 以将 Vuforia 设为您的主要活动.

It's still in beta as we're working out the kinks. If you still have the old version of the Facebook SDK on your project, after importing this go to "Facebook->Edit Settings" then inside the "Android Build Settings" tab, click "Regenerate Android Manifest". That should modify it with the new facebook activities. You should then be free to modify your AndroidManifest.xml to make Vuforia your main activity.

这篇关于如何使用 Facebook SDK for Unity 和 Vuforia for Android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆