I am deploying an app using Sencha Architect 2 and i have a facebook and twitter integration which works fine on webserver but when i deploy the app to a device it doesn't work.
For facebook you can wrap in phonegap and then use their facebook plugins. For twitter you'll have to develop your own hybrid authentication scheme.
The problem your encountering is likely because of the authentication schemes and their callbacks (there is no callback url on a mobile device).
It's doable but complex.
Originally Posted by amfailla
I am deploying an app using Sencha Architect 2 and i have a facebook and twitter integration which works fine on webserver but when i deploy the app to a device it doesn't work.
Sorry, I'm not using Architect. I wrote all my code in Sencha, and wrapped with Cordova/Phonegap.
I suspect there isn't anything that you can use in Architect, though I'm sure if there is someone who uses architect will weigh in.
From what I've found, it's about the authentication scheme. In order to do nearly anything on Twitter you need authenticated user credentials, which you can use to make the signed oauth request. You can write the code to create and sign an oauth code in Sencha, but getting the user credentials (logging the user in) is the snag.
Facebook is a little easier, as you don't have to sign the requests, just pass the auth token with your request, but you still need to get the user credentials.
If you haven't become familiar with the Dev Docs for Facebook and Twitter on authentication, you should invest some time reading them (a thrilling read, I swear!).
On the plus side, you can do a search on twitter without being authenticated, but I doubt that's all the functionality you wanted.
Originally Posted by amfailla
i am using sencha architect 2 with a sencha app build native command to create my apk, is there anything i can use within Sencha Architect?
I have everything working perfectly but the only problem is the return URL of the facebook/twitter app ... how can i return to file:///android_assets/www/index.html ... ?!
I could maybe have some sort of middleware like a PHP script that returns me what the facebook/twitter app returned to it and set the return URL of my facebook/twitter App to the URL of the PHP script.
Yep, that's exactly the problem - you can't have it callback a local URL. What you need to do, is something akin to the Server side authentication example on Facebook, and then have your app retrieve the authentication token from the server (or else just run everything through a server)
Or... use phonegap and their plugins
Or... come up with a better way.
BTW, I found that my first proposal (the server side analogy) actually requires something like phonegap, because you have to present the user with the Facebook/Twitter auth page, but you can't show it in an iframe - hence, you need to launch a 'new browser window' something that phonegap lets you do (with the childbrowser plugin).
Guessing, the solution to this problem has ballooned out of control much more than you expected it to...
Don't you wish you'd been warned that it doesn't play nice with Facebook and Twitter before you started coding
Originally Posted by amfailla
thanks for quick replies man.
I have everything working perfectly but the only problem is the return URL of the facebook/twitter app ... how can i return to file:///android_assets/www/index.html ... ?!
I could maybe have some sort of middleware like a PHP script that returns me what the facebook/twitter app returned to it and set the return URL of my facebook/twitter App to the URL of the PHP script.