1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    25
    Vote Rating
    3
    amfailla is on a distinguished road

      0  

    Default Unanswered: Twitter & Facebook + Deployed App

    Unanswered: Twitter & Facebook + Deployed App


    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.

    Is there anything i can do to set this up?


    Thanks

  2. #2
    Sencha User
    Join Date
    Apr 2012
    Posts
    164
    Answers
    13
    Vote Rating
    9
    in4p will become famous soon enough

      0  

    Default


    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.

    Quote Originally Posted by amfailla View Post
    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.

    Is there anything i can do to set this up?


    Thanks

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    25
    Vote Rating
    3
    amfailla is on a distinguished road

      0  

    Default


    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?

    Thanks

  4. #4
    Sencha User
    Join Date
    Apr 2012
    Posts
    164
    Answers
    13
    Vote Rating
    9
    in4p will become famous soon enough

      0  

    Default


    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.

    Quote Originally Posted by amfailla View Post
    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?

    Thanks

  5. #5
    Sencha User
    Join Date
    Oct 2012
    Posts
    25
    Vote Rating
    3
    amfailla is on a distinguished road

      0  

    Default


    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.

    Do you think this would work?

    Thanks again!

  6. #6
    Sencha User
    Join Date
    Apr 2012
    Posts
    164
    Answers
    13
    Vote Rating
    9
    in4p will become famous soon enough

      0  

    Default


    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

    Quote Originally Posted by amfailla View Post
    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.

    Do you think this would work?

    Thanks again!

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."