29 Nov 2011 10:30 AM #1
Phonegap facebook api session issue
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?
29 Nov 2011 1:23 PM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
What does this have to do with Sencha Touch 1?Mitchell Simoens @LikelyMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
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 firstname.lastname@example.org
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.
29 Nov 2011 9:11 PM #3
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.
1 Dec 2011 3:06 AM #4
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