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

亡梦爱人 提交于 2019-11-27 08:45:01

问题


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.


回答1:


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/

Basically we deprecated requiring FBUnityPlayerActivity to be the main activity. 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". 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.



来源:https://stackoverflow.com/questions/20928723/how-to-work-with-facebook-sdk-for-unity-and-vuforia-for-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!