Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Closing Window Error on Device

Hello,

I am using Spazcore api to get Twitter access token and secret here is what I am doing.

  1. User enter twitter username and password and Titanium then fires event (which contains entered username and password) to a web view in which the authorization will take place.
  2. Then Titanium opens a webview and authorization will take place, on success webview will fireback access token and access secret to the parent window.
  3. And window contains webview will close down.

When I run the code in emulator everything works just fine but when I try it on device it is not closing down the window on authorization success.

Can anyone tell what could be the problem?

— asked August 2nd 2010 by Altaf Sayani
  • webview
  • window
0 Comments

3 Answers

  • Accepted Answer

    Oh, forgot to mention this : if you are using 1.4, you will have to patch the fixed TiUtils.m Otherwise, you'll need 1.4.1 (last link). You are fine, i guess, it's just the url escaping bug that's throwing you off.

    https://appcelerator.lighthouseapp.com/projects/32238/tickets/1412-iphone-usernamepass-on-url-https-only-will-break

    http://builds.appcelerator.com.s3.amazonaws.com/index.html

    — answered August 2nd 2010 by Daniel Lim
    permalink
    1 Comment
    • Thanks for the help Daniel, it works perfectly fine now.

      — commented August 3rd 2010 by Altaf Sayani
  • Not sure about Spazcore, but why inventing the wheel if there's already solutions out there for us?

    I'm using Twitter Xauth mentioned here, no pins and webview involved, fairly simple.

    http://developer.appcelerator.com/question/4581/custom-module

    But if you are still interesting in webview with oAuth implementation, try this.
    http://developer.appcelerator.com/blog/2010/07/twitter-oauth-implementation-for-titanium-mobile.html

    — answered August 2nd 2010 by Daniel Lim
    permalink
    0 Comments
  • Thanks for the help Daniel,

    but when I try running the code it gives me authentication needed error while I guess everything is setup correctly.

    Here is what my code looks like http://pastie.org/1071516

    Can you share the code which is working fine for you, would be really helpful.

    Thanks.

    — answered August 2nd 2010 by Altaf Sayani
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.