Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Facebook Android Plugin - Page 5 — Gideros Forum

Facebook Android Plugin

1235»

Comments

  • ar2rsawseenar2rsawseen Maintainer
    edited April 2016
    This error happens because com/giderosmobile/android/plugins/facebook/GFacebook is not found. Which is part of Gideros Facebook plugin. So probably you put it in some other place, not where it should be according to Android Studio.
    I think in Android studio they should be in \src\main\java\com\giderosmobile\android\plugins\facebook
  • simwhisimwhi Member
    edited April 2016
    So I managed to get the facebook SDK working with Android Studio.

    As promised, here is the facebook integration guide. I wrote the guide as I completed each step / or on occasions when I had to redo a step again. It worked for me so I hope it works for the community too. Let me know if you have any issues or find any errors.

    The guide is pretty comprehensive (and long) as I wanted to make it as clear as possible for new developers.

    Enjoy.
    doc
    doc
    How to set up Facebook plugin with Android Studio.doc
    567K
    +1 -1 (+6 / -0 )Share on Facebook
  • I will now start working on a complete Facebook Lua class that can be used by the community as well as provide the basis for basic to advanced facebook development tutorials.

    Likes: talis

    +1 -1 (+1 / -0 )Share on Facebook
  • talistalis Guru
    edited April 2016
    Thank for sharing. Really great job :)>- =D>
  • antixantix Member
    Yeah, thanks heaps! If I ever do facebook stuff this will be gold :D
  • You are most welcome.
  • simwhisimwhi Member
    edited April 2016
    When I call
    function FacebookManager:sendAppRequests(params)
      if not params then
        params = {message = "Check out this awesome app"}
      end
      facebook:dialog("apprequests", params)
    end
    I get the application request dialogue as expected. but when I click on the dialogue's cancel button my player crashes. How can I handle this button? I see that Event.DIALOG_CANCEL is now nil. Does this mean that the dialogue cancel event is no longer supported?

    I can handle when the user clicks the small x as a dialogue error event is called.

  • ar2rsawseenar2rsawseen Maintainer
    Do you have a log with which your player crashes on cancel button?
    And yes there are only two events, Dialog complete and dialog error
    cancel should be dialog error with error message as Canceled
  • @ar2rsawseen I will try it out in Android Studio and let you know.
  • @ar2rsawseen Here is the log
    txt
    txt
    appRequestErros.txt
    11K
  • ar2rsawseenar2rsawseen Maintainer
    ok, so it means error happens in one of these lines:
    https://github.com/gideros/gideros/blob/master/plugins/Facebook/source/Android/jni/gfacebook.cpp#L262-L263

    which means somewhere in this class null is passed to onDialogError:
    https://github.com/gideros/gideros/blob/master/plugins/Facebook/source/Android/src/com/giderosmobile/android/plugins/facebook/GFacebook.java#L412

    I suspect it could be this line:
    https://github.com/gideros/gideros/blob/master/plugins/Facebook/source/Android/src/com/giderosmobile/android/plugins/facebook/GFacebook.java#L424

    can you try to change it to something else like:
    GFacebook.onDialogError(action, "error", GFacebook.sData);
    just to verify that error is really there
  • @ar2rsawseen Great! That has removed the error from my APK.

    I also get a a dialogError callback event now with an e.type = "appRequest" and e.error = "error" when I execute the code in my custom player. This, I expected.

    Presumably, error.getLocalizedMessage() is returning something (local characters) that cannot be handled, or am I wrong? If this is true, what is the best course of action?

  • A question oauth dialogue. Is there a purpose to the oauth didalog? When I call this:

    facebook:dialog("oauth", params)

    I get the dialogue, but with a message informing me that permissions have already been granted. The app has already logged in, but with minimal permissions (get) data. I want to get the user to authorise additional permissions (post data).

    Should I use the login function again with the additional permissions?





  • As promised, here is a a Lua class implementation/wrapper for the Gideros facebook plugin.

    1. Include it in your Gideros project
    2. Create an instance in main or somewhere in your app setup logic using:
    fb = FacebookManager.new("your app  ID")
    3. On successful login, _logInComplete will execute. Within this function there are many commented out function calls that test each feature. self:getProfile() is called by default.

    NOTE: For the sake of simplicity this class does not include any event dispatching to calling scenes etc. The purpose is to help new users get up and running.

    If you experience any issues, or you find any errors, please let me know.

    Enjoy!!
    lua
    lua
    facebook-manager.lua
    15K

    Likes: pie, jdbc, HubertRonald

    +1 -1 (+3 / -0 )Share on Facebook
  • ar2rsawseenar2rsawseen Maintainer
    @simwhi probably something with localization, I will change it to some default error text

    And about oauth, when I implemented facebook plugin, I don't think there were oauth dialogs. But yeah, you probably don't need it, cause all authentication is done internally.
  • @ar2rsawseen Thanks for your help and info. I'll remove it from my facebook Lua class example.

    Likes: antix

    +1 -1 (+1 / -0 )Share on Facebook
  • simwhisimwhi Member
    Hi everyone,

    Just to keep you all abreast of new Facebook experimentation/development, I have now managed to get v3.23.1 of the SDK working in Android Studio. This SDK uses a version of the Graph API that will be deprecated in July 2017 rather than v3.14 which will be deprecated in August 2016.

    Also, with my new found knowledge of Android Studio, adding the FB dependency is much easier now. To update the SDK make the following changes to your app's build.gradle file.

    1. Add this before dependencies
    repositories {
        mavenCentral()
    }
    2. Add this to your dependencies:
    dependencies {
        ...
        compile 'com.facebook.android:facebook-android-sdk:3.23.1'
        ...
    }
    If you are adding Facebook from scratch, make sure that you following my installation guide posted in this thread above.

    Enjoy!
  • Hi @simwhi
    like you said " I'm obviously missing something, or the instructions are out of date, or both!!"
    I've tried to implementing facebook android in my project but still nothing :-/

    My struct project is
    image

    My AppActivity is
    image

    My app's build.gradle
    image

    My manifest
    image

    My string file
    image

    Permisions.java
    image

    GFacebook.java
    image

    GFacebook.java (again)
    image

    I've got it these erros
    image

    image

    Somebody to support me thanks!!!
    01_Project.jpg
    305 x 239 - 24K
    02_MyAppActivity.jpg
    650 x 678 - 109K
    03_appBuildeGradle.jpg
    578 x 321 - 47K
    04_manifest.jpg
    636 x 116 - 28K
    05_string.jpg
    508 x 113 - 20K
    06_Permisions_dot_java.jpg
    548 x 124 - 27K
    07_GFacebook_dot_java.jpg
    597 x 168 - 32K
    08_GFacebook_dot_java2.jpg
    513 x 93 - 16K
    09_Error.jpg
    1372 x 1193 - 292K
    10_error2.jpg
    1217 x 725 - 151K
  • Hi @simwhi
    like you said " I'm obviously missing something, or the instructions are out of date, or both!!"
    I've tried to implementing facebook android in my project but still nothing :-/
    ... images
    Somebody to support me thanks!!!
    Has used somebody this plugin currently?
    Is facebook android plugin working?
    I appreciate any help, thanks you
  • @HubertRonald

    Follow the guide as provided in the link posted above. If you experience any issues you can post here again.
  • hgy29hgy29 Maintainer
    Guys, why don't you just tick Facebook in the plugin selection pane and let gideros do the job for you ?
    +1 -1 (+3 / -0 )Share on Facebook
  • SinisterSoftSinisterSoft Maintainer
    edited April 2017
    Yes, this works fine. :) (ticking facebook in the plugin selection panel)
    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
  • @hgy29 and @simwhi thanks for your response ;)
    I've only changed
    dependencies {
        ...
        compile 'com.facebook.android:facebook-android-sdk:4+'
        ...
    }
    to
    dependencies {
        ...
        compile 'com.facebook.android:facebook-android-sdk:3+'
        ...
    }
    And now it's ok

    Likes: simwhi

    +1 -1 (+1 / -0 )Share on Facebook
  • Guys, why don't you just tick Facebook in the plugin selection pane and let gideros do the job for you ?
    Hi @hgy29 I've got explain more details about this part in the next link
    http://giderosmobile.com/forum/discussion/6741/gideros-2016-10-released#Item_64

    Because I wanted to be more confident about it before commenting on your answer
    Thanks again
    P.D. I'm using Gideros 2017.3.1
  • simwhisimwhi Member
    edited August 2017
    Hi

    I think that the facebook SDK v3.23.1 using Graph API v2.2 has now been deprecated. How difficult / time consuming would it be to upgrade to the latest version of the SDK?

    I vaguely recall not being able to use anything above v3.32.1.
  • hgy29hgy29 Maintainer
    I made an attempt last year, but finally gave up given the amount of changes involved...
Sign In or Register to comment.