Results 1 to 4 of 4

Thread: How to "login" when use Sencha-Touch + phoneGap?

  1. #1
    Sencha User
    Join Date
    Jul 2011
    Posts
    6
    Vote Rating
    0
      0  

    Question How to "login" when use Sencha-Touch + phoneGap?

    I have some confrustion when I dev a web app with Sencha-Touch and phoneGap.

    1. Does it means we must use JSON-P instead of JSON?
    (because it is a app, so it has the cross-domain problem)

    2. What is the best approach if the server is RESTful(request and get JSON response)?
    I saw we need rewrite some server code(such as add "callback" param) if use JSON-P.

    3. How to manage auth such as login function?
    how does the session/cookie works in this app?
    Is there any example?

  2. #2
    Sencha User
    Join Date
    Aug 2010
    Posts
    311
    Vote Rating
    5
      0  

    Default

    Hi, you can use json, no need to use jsonp. When you package an app with Phonegap there is no cross domain problem because you haven't a "starting url". I suggest to use server side session variable, is what i do. Once you login you can check the validity of the session variable at every ajax call. If you dont have ajax call after login just check the validity of session variable at regular interval (setInterval) with a an ajax call to the server.

  3. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    28
    Vote Rating
    0
      0  

    Default I am also facing same problem

    Hello,
    I am facing same cross domain ajax problem.
    When I am sending a ajax request to a server after package up the app with phone gap
    But no response returns.

  4. #4
    Sencha User Sameer Khan's Avatar
    Join Date
    Oct 2011
    Location
    Bangalore, India
    Posts
    115
    Vote Rating
    0
      0  

    Default Hi, Ext.Ajax.Request

    Ext.Ajax.reqeust() ..restricted to do cross domain communication...So use JSONP or JSON but not Ajax.request()
    Sameer Khan

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •