Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Problem with the new Android Facebook plugin — Gideros Forum

Problem with the new Android Facebook plugin

somezombiegmsomezombiegm Member
edited May 2015 in General questions
Hello, I'm trying to set up the latest Facebook plugin (for Android) which I was told was this one: https://github.com/gideros/giderosplugins/tree/master/Facebook

I downloaded the FacebookSDK from dependencies (facebook-android-sdk-3.14) and tested the example but I can't run it. I pasted the source/Android/libs and everything from src/com/giderosmobile/android/plugins/facebook to that example.

And I also modified:
- My main activity:
Added the lib System.loadLibrary("facebook").
Added the external class as "com.giderosmobile.android.plugins.facebook.GFacebook".
- res/values/strings.xml:
Added a string with name: facebook_app_id, value: Facebook
- AndroidManifest.xml:
Added a metadata with name: com.facebook.sdk.ApplicationId, value: @string/facebook_app_id

And the problem is that when I run it on Eclipse with an Android device, I get a message saying my app has stopped, that's it. Please help.

Comments

  • ar2rsawseenar2rsawseen Maintainer
    Accepted Answer
    Hello @somezombiegm
    use the binaries available with Gideros release in All Plugins folder as they are built specifically for the release you have installed :)
  • Problem solved! thanks for helping a noob here :)
  • Hello,
    I also have a problem here.
    I set up my plugins from "All Plugins" without problem, and I tested it fine. I use 3.14 Facebook SDK.
    login/logout work, along with all getters.
    I can retrieve from gideros all data about friends, pictures, profiles, scores perfectly.

    I can't do any post though.
    Here is the error for a postScore({lvl = 2000}):
    http://pastebin.com/7TnJA8Em

    From this page:
    https://developers.facebook.com/docs/sharing/android

    It appears that sharing operations on facebook require a specific "provider" in the manifest, but I can't start my player if I add it, because com.facebook.FacebookContentProvider is not found.
    Has this change in Facebook SDK?

    Any idea?

    Thanks in advance
  • ar2rsawseenar2rsawseen Maintainer
    I think postScore key was supposed to be score
    postScore({score= 2000})
    Also to post score your app on facebook should have genre: game

    Also you need to include publish permissions when loging in

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
  • SinisterSoftSinisterSoft Maintainer
    That looks correct to me, but I used:
    facebook:post("/"..facebookID.."/scores",{score=playerScore})
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • @ar2rsawseen
    My app is a game on facebook dev website. And I login with publish_actions successfully (I see two facebook permission screen for read and write permissions at login).

    @sinistersoft
    I tried with:
    facebook:post("/me/scores",{score=playerScore})
    but it failed the same way...

    Have you tried to install Facebook plugin from scratch on a new project recently?
  • SinisterSoftSinisterSoft Maintainer
    Yes, it works for me - using it in Dungeons game.

    https://www.facebook.com/DungeonsArcadeGame
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • @SinisterSoft
    Can you precise how you configured your Android project?
    Thanks!
  • SinisterSoftSinisterSoft Maintainer
    edited June 2015
    huh? What do you mean?

    I include the facebook plugin + I also include the official facebook lib in the eclipse android properties (like you would for other things, eg google play).

    I also have a facebook app page and id, that I use in gideros.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • SinisterSoftSinisterSoft Maintainer
    btw, my:
    facebook:post("/"..facebookID.."/scores",{score=playerScore})
    looks different than your:
    facebook:post("/me/scores",{score=playerScore})
    I just use the id that I found out earlier.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • Well, for example I had to configure things according to facebook website recommandation (https://developers.facebook.com/docs/android/getting-started/). One of those required to add the login activity in the manifest, but I had to change from "FacebookActivity" to "LoginActivity".
    As for sharing, it is also required to add a FacebookContentProvider with my app id, but the package "com.facebook.FacebookContentProvider" does not exist in my facebook SDK...

    @SinisterSoft
    Did you configure anything related to facebook in you Manifest?
  • SinisterSoftSinisterSoft Maintainer
    edited June 2015
    Just:
    <activity android:name="com.facebook.LoginActivity" 
    android:theme="<a href="https://forum.gideros.rocks/profile/android" rel="nofollow">@android</a>:style/Theme.Translucent.NoTitleBar" 
    android:label="<a href="https://forum.gideros.rocks/profile/string%2Fapp_name%26quot" rel="nofollow">@string/app_name&quot</a>; />
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
Sign In or Register to comment.