WHAT I WANT TO GET
I am trying to run an example application included in PhoneGap Facebook Plugin on Android.
PROBLEM
When you click "Enter", the dialog box asks for my permission ( screenshot ), but after clicking "OK" it returns to the main screen and nothing happens.
WHAT I ARTED
I installed the Facebook APK on my phone and the Android SDK in Eclipse and linked the SDK to the sample application. I also created my key hash using the keystore that I use to export the application and added it to the application configuration on Facebook.
I added com.facebook.LoginActivity to the manifest as shown below:
<manifest> ... <application android:icon="@drawable/icon" android:label="@string/app_name" android:hardwareAccelerated="true" android:debuggable="true"> <activity android:name="TestaFB" android:label="@string/app_name" android:theme="@android:style/Theme.Black.NoTitleBar" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.facebook.LoginActivity" android:label="@string/app_name" /> </application> </manifest>
And added a plugin like this in res/xml/config.xml :
<cordova> <plugins> ... <plugin name="org.apache.cordova.facebook.Connect" value="org.apache.cordova.facebook.ConnectPlugin" /> </plugins> </cordova>
I modified index.html to use the version of the cord I am using (2.6.0) and put my appId in JS:
document.addEventListener('deviceready', function() { FB.init({ appId: '361413583977115', nativeInterface: CDV.FB, useCachedDialogs: false }); FB.getLoginStatus(handleStatusChange); authUser(); updateAuthElements(); });
I have no idea what I did wrong.
However, I found out that if I allow an application that uses my computer and then try to use the application, it works.
source share