Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Facebook documentation incorrect. — Gideros Forum

Facebook documentation incorrect.

SinisterSoftSinisterSoft Maintainer
edited January 2014 in Bugs and issues
The documentation shows the Android and iOS icons, yet still says this:

"Facebook SDK plugin is available for only iOS as an external plugin. To use facebook module:"

Also it does not give links to the Android download sdk, but does for iOS.
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
«134

Comments

  • Ahh, Facebook sdk is something that is always on my mind.
    Unfortunately currently I think Facebook does not provide compatible Android SDK anymore, and the only one you can get was in the repo:
    https://github.com/ar2rsawseen/GiderosFacebookAndroidPlugin

    But new SDK versions, are so different (IOS and Android), that creating same API for them is very hard, if not impossible.

    So more and more I'm leaning towards creating universal Lua module for facebook. Which could actually be quite easy, but then again, you won't be able to show facebook dialogs and would need to create everything yourself, and then there is the support with Facebook app installed and without it. So again a dead end.

    Makes me very very unhappy :(
  • ...
    So more and more I'm leaning towards creating universal Lua module for facebook. Which could actually be quite easy, but then again, you won't be able to show facebook dialogs and would need to create everything yourself, and then there is the support with Facebook app installed and without it. So again a dead end.

    Makes me very very unhappy :(
    Me too. I wrestled with trying to get something useful working using the fb:// from within Gideros on Android, but can't get more than just the native FB app to go to the main screens (post, notes, etc.). It won't do the nicely formed post that the "deprecated" http://www.facebook.com/sharer.php? does.
    @ar2rsawseen have you seen any actual user posts completing with sharer.php approach? By that I mean, are the users discouraged when presented a login screen from the fb webpage and return back to the game? Or do they go on to complete the post? Just curious.
  • @ar2sawseen no point sticking with the old facebook api, it will be depreciated. May as well burn the bridges and change the gideros facebook interface as you move to 2.0...
    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
  • ar2rsawseenar2rsawseen Maintainer
    edited January 2014
    @SinisterSoft after your initial post, I actually spend whole night playing with new Facebook SDK 3.5 and I say I almost finished a prototype for Android. I create only couple of basic methods natively and wrapped all other on the C level, so it will be reused on IOS too. I think this will come out much better than I anticipated.

    The hardest part was the authorization workflow, login, relogin, permissions, etc plus there are two types of authorizations, read only and publish.

    Lucky for you guys that all will be dealt internally, all you guys will have is login/logout methods and provide sufficient permissions :)

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
  • ar2rsawseenar2rsawseen Maintainer
    edited January 2014
    And while we are on this note, what kind of functionality you are mostly using in facebook, in your apps.
    For now I've wrapped methods like this
    Methods
    --authentication
    login(appId, permissions)
    logout()
     
    --requests information
    get(path, params) --general request for any graph query
    getProfile(params)
    getFriends(params)
    getAlbums(params)
    getAppRequests(params)
    getScore(params)
     
    --publish information
    post(path, params) -- general post for any information
    postScore({score: 123})
    postPhoto(path, {message: , place: , album:})
    postToFeed({message, link, picture, name, caption, description})
     
    --delete
    delete(objectId) --id of the object to delete
     
    --dialogs
    dialog(type, params)
    inviteFriends({message, to, suggestions})
    share({message, link, picture, name, caption, description})
    Events
    Event.LOGIN_COMPLETE
    Event.LOGIN_ERROR --contains (e.errror)
    Event.LOGOUT_COMPLETE
    Event.LOGOUT_ERROR --contains (e.errror)
    Event.DIALOG_COMPLETE --contains (e.type)
    Event.DIALOG_ERROR --contains (e.type, e.errror)
    Event.REQUEST_COMPLETE --contains (e.type, e.response)
    Event.REQUEST_ERROR --contains (e.type, e.errror)
     
    --e.type is basically type/path you passed to graph request or dialog, 
    --so you would know from what request are you receiving the response
    anything else you might be interested in? :)

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
  • I want to use it when writing a game like jelly splash, bejewelled, candy crush, etc... so I'll need to get friend information and if possible any data that I can use Facebooks servers for - level progress data, scores, etc...

    Can you do this with Facebook - do they allow you to save things like multiple scores per game (I have one per level, etc)... or will I need to link to my own server for that kind of stuff?
    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 currently it seems they only allow to save one single score per user, and it only gets overridden if you post a higher score
  • yep, it looks like I'll have to use the facebook id as an index into my own database, I'll have to write some back-end code for it.
    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
  • You could always use GooglePlayService cloud to store the data across devices
  • SinisterSoftSinisterSoft Maintainer
    edited January 2014
    That's what I was also thinking (whilst having something to eat :) ).

    Do you know if you can grab the 'score' from other Facebook users playing the same game?

    If so I can use the level progress as the score. I can then put the facebook image on a map within the game at that particular level.

    I think I'm going to add a feature like:

    Connect to facebook : Gain 200 coins and see which of your friends is playing, see your friends on the map [if i can grab their 'score'!!!!]

    Connect to Google : Gain a further 200 coins, add leaderboards and more...

    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 sure you can, facebook:getScore(params) will get you all the scores of your app, then you need to call getFriends and match them together to only show friend scores
  • That's great. I won't actually use it as scores - but as level numbers (to put the player on the map).

    So...... this leads to the obvious question:

    When will the updated plugin be ready? :)
    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
  • Sorry to put on the pressure! :D
    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
  • The Android is basically ready, but on IOS still struggling to get around how developers intended we would use it, to how Gideros could use it :(
  • Is the api not basically the same (on the FB side)? If it does't look like the current Gideros FB api then maybe call it Facebook3 ?
    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
  • to avoid confusion? maybe, will think about it

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
  • If Facebook insist on changing major things each major api revision then you might have no choice. :(
    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
  • If the iOS version is going to follow the Android version, are you going to release the new Facebook api as an alpha in the Labs?
    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
  • Yes, and hopefully this week
    +1 -1 (+2 / -0 )Share on Facebook
  • Cant wait for new facebook sdk plugin :D @ar2rsawseen

    Likes: SinisterSoft

    have fun with our games~
    http://www.nightspade.com
    +1 -1 (+1 / -0 )Share on Facebook
  • No pressure, huh? :D

    Unfortunately did not get too much into that yet, but no worries, weekend are usually my most producible days ;)

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
  • Would be handy to get the Android version if the iOS version might take longer, then I'll get started putting it in the new game and test it for you. :)
    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
  • I've been trying to get it working, I tried with your 3.5 facebook sdk but I keep gettings this error when making an apk:

    Conversion to Dalvik format failed with error 1

    I downloaded the 3.6 facebook api and now I don't get the error.

    The program works, it tries to loginto facebook but there are no event messsage. After about 1.5 seconds the app goes black screened and it exits.

    Any ideas?
    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 it is alpha you know :)
    Currently no idea, will check. And did facebook released another SDK update :O
  • Yes, found that last night - so I tried again with the 3.5 lib you included. Same result , a crash after a couple of seconds.

    It doesn't happen if I just require facebook and nop out the facebook:login, etc..

    Maybe it has something to do with messages coming back after the command? (thats why it takes a while?)

    Do I have to add something to the AndroidManifest.xml ???

    If I send to the device in Eclipse I get this in the error stream:

    01-25 11:12:27.600: E/(13639): Device driver API match
    01-25 11:12:27.600: E/(13639): Device driver API version: 23
    01-25 11:12:27.600: E/(13639): User space API version: 23
    01-25 11:12:27.600: E/(13639): mali: REVISION=Linux-r3p2-01rel3 BUILD_DATE=Wed Oct 9 21:05:57 KST 2013
    01-25 11:12:32.605: E/AndroidRuntime(13639): FATAL EXCEPTION: main
    01-25 11:12:32.605: E/AndroidRuntime(13639): com.facebook.FacebookException: Cannot use SessionLoginBehavior SSO_WITH_FALLBACK when com.facebook.LoginActivity is not declared as an activity in AndroidManifest.xml
    01-25 11:12:32.605: E/AndroidRuntime(13639): at com.facebook.Session.validateLoginBehavior(Session.java:1030)
    01-25 11:12:32.605: E/AndroidRuntime(13639): at com.facebook.Session.open(Session.java:953)
    01-25 11:12:32.605: E/AndroidRuntime(13639): at com.facebook.Session.openForRead(Session.java:388)
    01-25 11:12:32.605: E/AndroidRuntime(13639): at com.giderosmobile.android.plugins.facebook.fbsimple.SimpleFacebook.openSession(SimpleFacebook.java:421)
    01-25 11:12:32.605: E/AndroidRuntime(13639): at com.giderosmobile.android.plugins.facebook.fbsimple.SimpleFacebook.login(SimpleFacebook.java:135)
    01-25 11:12:32.605: E/AndroidRuntime(13639): at com.giderosmobile.android.plugins.facebook.GFacebook$1.run(GFacebook.java:91)
    01-25 11:12:32.605: E/AndroidRuntime(13639): at android.os.Handler.handleCallback(Handler.java:730)
    01-25 11:12:32.605: E/AndroidRuntime(13639): at android.os.Handler.dispatchMessage(Handler.java:92)
    01-25 11:12:32.605: E/AndroidRuntime(13639): at android.os.Looper.loop(Looper.java:176)
    01-25 11:12:32.605: E/AndroidRuntime(13639): at android.app.ActivityThread.main(ActivityThread.java:5419)
    01-25 11:12:32.605: E/AndroidRuntime(13639): at java.lang.reflect.Method.invokeNative(Native Method)
    01-25 11:12:32.605: E/AndroidRuntime(13639): at java.lang.reflect.Method.invoke(Method.java:525)
    01-25 11:12:32.605: E/AndroidRuntime(13639): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
    01-25 11:12:32.605: E/AndroidRuntime(13639): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
    01-25 11:12:32.605: E/AndroidRuntime(13639): at dalvik.system.NativeStart.main(Native Method)
    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
  • Yes, sorry I completely forgot. Will add to install instructions:
    <activity android:name="com.facebook.LoginActivity"
                      android:theme="<a href="https://forum.giderosmobile.com/profile/android" rel="nofollow">@android</a>:style/Theme.Translucent.NoTitleBar"
                      android:label="<a href="https://forum.giderosmobile.com/profile/string%2Fapp_name%26quot" rel="nofollow">@string/app_name&quot</a>; />
  • SinisterSoftSinisterSoft Maintainer
    edited January 2014
    That works now. :)

    Each time I do the login I get asked about permissions. How do you make it so you only get asked this once?

    edit:

    After a couple of goes it stopped asking for permission, seems ok now.
    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
  • Hmm interesting, did not experience that, but will try to unauthorize the app and try again. As I said, very, very complex authentication/session system
Sign In or Register to comment.