Titanium Community Questions & Answer Archive

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

Managing an app layout using a remote JSON source...

Hi all,
Just thought I'd share my findings today. Several leads I've gotten needed a way to manage color schemes and a few other things regarding layout. I didn't really want to have to submit client apps to the store every time a color change occurred (for a season for instance). I discovered you can actually manage the layout using remote sources. Here's an example of how to do it: http://beautyindesign.com/screencasts/titanium-update-an-iphone-app-with-a-remote-json-source/

Obviously you'd want to cache the results so it doesn't have to call the remote source every time but it did make me realize that an entire application could be managed / changed from remote sources. Crazy.

— asked October 26th 2010 by Rick Blalock
  • json
0 Comments

5 Answers

  • Thanks sharing this. I was just about to start a project for a client that did this. Glad to see its so easy to do!

    — answered October 26th 2010 by Andrew Scofield
    permalink
    0 Comments
  • Last time i checked that function portion of your code is against Apple's terms.

    — answered October 26th 2010 by Sj Singh
    permalink
    1 Comment
    • Thanks for pointing that out. You have a reference from Apple about that?

      — commented October 26th 2010 by Rick Blalock
  • You are right, that is questionable. You could pass the text to be shown in an alert but passing an actual Javascript function or code would likely get you banned.

    — answered October 26th 2010 by John McKnight
    permalink
    0 Comments
  • Thanks John for the clarification. I haven't personally read where Apple explicitly bans this so it was news to me.

    — answered October 26th 2010 by Rick Blalock
    permalink
    0 Comments
  • https://developer.apple.com/appstore/resources/approval/guidelines.html

    2.7 Apps that download code in any way or form will be rejected

    2.8 Apps that install or launch other executable code will be rejected

    — answered October 26th 2010 by John McKnight
    permalink
    2 Comments
    • Thanks for the reference! 2.7 is intentionally vague I assume. JSON could be considered "code" which means every twitter app on the planet is in violation of 2.7. 2.8 makes it clearer though (although it's still a little vague).

      — commented October 26th 2010 by Rick Blalock
    • Agreed on 2.7 & 2.8 and the vagueness could easily lead to misinterpretation of their intent. Apple generally frowns on code or mechanisms that could lead to the remote retrieval and execution of code because of security and privacy concerns.

      The funny part of that objection is Safari is a huge violator of these rules and the fact they allowed Opera into the app store is still a shock to me since it does violate 2.7 and 2.8 and secondarily some other rules about content.

      — commented October 26th 2010 by John McKnight
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.