Question

Unity 4.3.3f1

SDK Version 5.0.4

Build Version 140220.cc3a9c089a2eb9e


Hello, I've been developing a game for the past 4 months using the Facebook SDK for Unity and I've been experiencing an issue since last friday. Everytime I try to log in into my application from my app, the Result.Text from the method LoginCallback(FBResult result){} returns the following string:

{"is_logged_in":false,"user_id":"","access_token":"","access_token_expires_at":"01/01/0001 00:00:00"}

So, for some reason it's not getting the user_id nor is generating the correct token to use on the application.

I made sure that my Package Name, Class Name and Key Hashes match between my facebook settings on the Unity SDK andmy App Settings on Facebook, they do.

One thing I noticed that could mean something or not, I don't know is that the Class name is now

com.facebook.unity.FBUnityDeepLinkingActivity

on my FacebookSettings from Unity so I changed it to the same value on the my App Setting from Facebook.

I pushed the Regenerate Android Manifest button and this is my manifest in case it helps identify the 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:screenOrientation="portrait" android:configChanges="keyboardHidden|orientation">
    </activity>
    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\ 1422526867979289" />
    <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>

Any help would be greatly appreciated, thanks.

PS: Also, one quick question. Which is the manifest that works? The one located on:

Assets/Android/AndroidManifest.xml 

or the one on:

Assets/Plugins/Android/AndroidManifest.xml

Nevertheless, both Manifests are exactly the same as the one I posted here. Thanks.

Was it helpful?

Solution

As a fellow developer suggested, the problem was in fact that the Facebook Login stopped working when I added the Keystore to be able to upload my apk to the playstore. Whit the keystore added, I needed to process it with keytool and upload to my Facebook App Acount the newly created Keyhash.

For future reference, it would be good that whenever something like this happens the sdk can throw an exception or something instead of an empty array, it would be much simpler to try and solve the problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top