如何与Facebook SDK合作,团结和Vuforia为Android?团结、SDK、Facebook、Vuforia

2023-09-13 02:16:43 作者:深情何须显摆

我有一个问题,这两个插件一起工作:在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/

基本上我们去precated要求 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的生成设置选项卡内,单击重新生成的Andr​​oid清单。这应该与新的Facebook活动进行修改。然后,您应该可以自由地修改你的Andr​​oidManifest.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.