Facebook Unity SDK v5.0.4 - Trouble with login with mobile device

Some days ago, I used Facebook Unity SDK v5.0.3 and I tested successfully on my Android phone. But today I add another multi-platform plugin to my project(revmob-advertise), so it change my Androidmanifest.xml. Then I can't login using my Facebook Profile. I re-import the newest Facebook Unity Package and I think there may be some problems that I don't know because I changed my Manifest and build several times and the result wasn't change. This is my Android Manifest, please help me figure out my problem.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" android:installLocation="preferExternal" android:theme="@android:style/Theme.NoTitleBar" android:versionCode="1" android:versionName="1.0">
  <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
  <application android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="true">
    <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">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    </activity>
    <activity android:name="com.unity3d.player.UnityPlayerNativeActivity" 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>
    <activity android:name="com.facebook.LoginActivity" android:configChanges="keyboard|orientation|screenSize" android:theme="@android:style/Theme.Translucent.NoTitleBar">
    </activity>
    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\ 267548153412434" />
    <activity 
        android:name="com.facebook.unity.FBUnityLoginActivity" 
        android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" 
        android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
    </activity>
    <activity android:name="com.facebook.unity.FBUnityDeepLinkingActivity" android:exported="true">
    </activity>
  </application>
</manifest>

Answers


Facebook Unity SDK no longer requires to use main activity, so just use UnityPlayerActivity with "MAIN" action intent-filter or whatever your plugin needs to use but make sure your manifest file contains:

  • ApplicationId
  • LoginActivity
  • FBUnityLoginActivity
  • FBUnityDeepLinkingActivity

so just add this to manifest that whatever plugin you are using generated

    <activity android:name="com.facebook.LoginActivity" android:configChanges="keyboard|orientation|screenSize" android:theme="@android:style/Theme.Translucent.NoTitleBar">
    </activity>
    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\ 267548153412434" />
    <activity 
        android:name="com.facebook.unity.FBUnityLoginActivity" 
        android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" 
        android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
    </activity>
    <activity android:name="com.facebook.unity.FBUnityDeepLinkingActivity" android:exported="true">
    </activity>

Need Your Help

Why would I use VARCHAR over TEXT in MySQL?

mysql

I noticed that in MySQL, both VARCHAR and TEXT offer variable-sized data. Well, VARCHAR is a bit more efficient in data storage, but still, TEXT MEDIUMTEXT and LONGTEXT offer a lot more potential. ...

Watir with IronRuby!

ironruby watir

Has anyone used Watir with IronRuby successfully? I am getting an error that the required file 'Watir' was not found. What path do I need to set to get this file to work in IronRuby?