Hello,
I hope very very much please please anyone can help me …
I become very much crazy with this Facebook SDK, I hate the Facebook SDK …
I’m developing a game for Android, iOS and Windows using Unity3D, Android is the focus for now.
I installed the latest Facebook Unity SDK 14.1.0 and I’ve already spent 2 weeks getting the normal Facebook login to work because my app kept crashing after pressing the Facebook button. But now it’s finally working…
I just can’t get the express login to work at all.
I’ve been reading on the internet for days, tried so many things, it just doesn’t work…
I use this code as described 1000 times on the internet and in the Facebook developer documentation, but it just doesn’t work on the Android smartphone…
FB.Android.RetrieveLoginStatus(LoginStatusCallback);
private void LoginStatusCallback(ILoginStatusResult result)
{
if (!string.IsNullOrEmpty(result.Error))
{
Debug.Log("Error: " + result.Error);
}
else if (result.Failed)
{
// !!! This result always comes :-((( !!!
Debug.Log("Failure: Access Token could not be retrieved");
}
else
{
// Successfully logged user in
// A popup notification will appear that says
// "Logged in as <User Name>"
// !!! This result never comes, but it should come after I restart the app and I have
// successfully logged in before. !!!
Debug.Log("Success: " + result.AccessToken.UserId);
}
}
And this is my AndroidManifest.xml …
<?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:versionCode="1" android:versionName="1.0">
<queries>
<package android:name="com.facebook.katana" />
</queries>
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<application android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="false" android:allowBackup="false" android:fullBackupContent="false">
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
<receiver android:name="com.xxxxxxxxxxxxxx.SmsReceiver.SmsListener" android:enabled="true" android:exported="true">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
<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 android:name="com.facebook.unity.FBUnityDialogsActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.facebook.unity.FBUnityGamingServicesFriendFinderActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.facebook.unity.FBUnityAppLinkActivity" android:exported="true" />
<activity android:name="com.facebook.unity.FBUnityDeepLinkingActivity" android:exported="true" />
<activity android:name="com.facebook.unity.FBUnityGameRequestActivity" />
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="fbxxxxxxxxxxxxxxxxxxxx" />
<meta-data android:name="com.facebook.sdk.ClientToken" android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
<meta-data android:name="com.facebook.sdk.AutoLogAppEventsEnabled" android:value="true" />
<meta-data android:name="com.facebook.sdk.AdvertiserIDCollectionEnabled" android:value="true" />
<provider android:name="com.facebook.FacebookContentProvider" android:authorities="com.facebook.app.FacebookContentProviderxxxxxxxxxxxxxxxxxxxx" android:exported="true" />
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />
</manifest>
Minimum API level: 29 → Target API level: 32
I use also Amazon AWS with various services in my project.
All the Amazon AWS API’s is much more demanding and complex than the Facebook API, but strange thanks to excellent documentation I have absolutely no problems with it and everything just works except Facebook…
I just want the player to log in to my game app with Facebook once and when the app is restarted there shouldn’t be a message or anything, just silently log in with Facebook until the token expires or the app is deleted and reinstalled of course.
I’ve tested so many games apps everywhere it works, why not for me ?
Please help me, otherwise I’ll go crazy…
P.S. My Facebook Developer Account have Live Status, I tested all in real with Live Status.