freshplanet / ANE-Facebook

Air Native Extension (iOS and Android) for the Facebook mobile SDK
Apache License 2.0
221 stars 123 forks source link

Facebook.dialog not showing on Android #157

Closed agnithegreat closed 10 years ago

agnithegreat commented 10 years ago

I'm trying to get the "feed" dialog on Android, but absolutely nothing happens, even callback. But all right with iOS version.

_facebook = Facebook.getInstance();
_facebook.init(appID);
var readPermissions: Array = ["basic_info", "user_about_me", "read_friendlists"];
var publishPermissions: Array = ["publish_actions", "publish_stream"];
_facebook.openSessionWithPublishPermissions(readPermissions.concat(publishPermissions), handleOpenSession);
var params: Object = {"picture": url, "name": name, "caption": caption, "description": description};
if (to) {
  params.to = to;
}
_facebook.dialog("feed", params, handlePost);
agnithegreat commented 10 years ago

Finally, I found the solution. You should write brand-new activities for Android description.xml into github readme, not only into samples/HOW-TO.

<activity android:name="com.facebook.LoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:label="@string/app_name" />
<activity android:name="com.freshplanet.ane.AirFacebook.LoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"></activity>
<activity android:name="com.freshplanet.ane.AirFacebook.ShareDialogActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"></activity>
<activity android:name="com.freshplanet.ane.AirFacebook.ShareOGActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"></activity>
<activity android:name="com.freshplanet.ane.AirFacebook.WebDialogActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"></activity>
UmberFunk commented 9 years ago

@agnithegreat Thank you!!! You helped me a lot! Spent a lot of time trying to make it work until I found your comment. Just pasted it and everything is working now.