1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    62
    Vote Rating
    0
    slmd is on a distinguished road

      0  

    Default Phonegap facebook api session issue

    Phonegap facebook api session issue


    Hi
    I have installed the facebook API in phonegap but i have hard time making it work see link .The index.html file in the exemple folder has a login button that once taped opens the native facebook application on my device requiring email and password. After having authenticated me, it takes me back succesfully to my app.
    Whenever i tap on the "getsession" button for exemple it shows me an alert saying "undefined". I want to know how to get the access token that is given right after the authentication process within my app and everything related to the session so i can perform other tasks?
    Thank you

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    What does this have to do with Sencha Touch 1?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Aug 2011
    Posts
    62
    Vote Rating
    0
    slmd is on a distinguished road

      0  

    Default


    I am adding a facebook connect button within my sencha app in order to make it social. I assume some users have already done so.

  4. #4
    Sencha User
    Join Date
    Aug 2011
    Posts
    62
    Vote Rating
    0
    slmd is on a distinguished road

      0  

    Default


    I made it happen! Below is the solution in case someone needs it (for the phonegap facebook plugin installation refer to my first post)

    First of all create a Facebook app http://developers.facebook.com/apps
    It should be a native application app since you are compiling it with phonegap
    Fill in the App Domain and the website URL under WebSite
    Create a key hash (this will help) and submit it to facebook (DO NOT CREATE YOUR KEY ON WINDOWS)

    ... integrate your facebook api calls to your sencha app ...

    Export your application to a device or run it in a simulator

    It's your turn to make it happen

    A bit more information :
    I saw at some point in the eclipse logcat this message "Facebook-authorize LoginFailed: Invalid Key". After a long time googling and trying different solutions the one i am proposing above worked for me. My problem was due to the fact i didn't know i should create a key hash first (to make it short, Facebook apparently needs it) and second i made the error of generating it on windows (64 bits) which was genarting a bad key hash.
    Last edited by slmd; 1 Dec 2011 at 9:14 PM. Reason: More infos

Thread Participants: 1

Tags for this Thread