简体   繁体   English

如何使用适用于Unity的Facebook SDK和适用于Android的Vuforia?

[英]How to work with Facebook SDK for Unity and Vuforia for Android?

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" 我在使用这两个插件时遇到问题:在AndroidManifest.xml上,两个插件都必须为“ 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. 我认为这很普遍。

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/ 我们拥有SDK v5.0.2的Beta版,以尝试解决此问题: https : //developers.facebook.com/docs/unity/downloads/

Basically we deprecated requiring FBUnityPlayerActivity to be the main activity. 基本上,我们不建议要求FBUnityPlayerActivity为主要活动。 This should allow you to use whatever main activity you like. 这应该允许您使用任何您喜欢的主要活动。

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". 如果您的项目上仍具有旧版本的Facebook SDK,则在导入后转到“ Facebook->编辑设置”,然后在“ Android Build设置”选项卡中,单击“重新生成Android清单”。 That should modify it with the new facebook activities. 那应该用新的facebook活动对其进行修改。 You should then be free to modify your AndroidManifest.xml to make Vuforia your main activity. 然后,您应该可以随意修改AndroidManifest.xml,使Vuforia成为您的主要活动。

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

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