May 6, 201214 yr I've decided to try and teach myself the basics of iPhone app development as I want to try and make a small app for my website, I was wondering if the way I think it works is correct and if anyone could give me any pointers. I have my website and my database. I create a php page on my site that takes values from the url and with those values queries the database, returning a JSON object. In the iPhone app I make a script that sends a http request that returns the JSON. I think that's right... If you want to write to the database from the iPhone app, do you need a completely separate PHP page where you write to the DB instead of reading, or should it be done in the same page?
May 6, 201214 yr That's pretty much it in a nutshell. I recently developerd a CMS to manage data for an app and generate JSON data files which the app pulled in as required.
May 6, 201214 yr Author That's pretty much it in a nutshell. I recently developerd a CMS to manage data for an app and generate JSON data files which the app pulled in as required. Ok cool, I think first thing I'm going to do is create the page on my site that returns the JSON. Then I can start to look at learning the objective-C and testing it Edited May 6, 201214 yr by adamsmith
May 7, 201214 yr Author If I want to add lots of info to the database is it just a case of adding each thing to the URL and having a really long URL or is there another way to add the data. Maybe via POST instead of GET. Is there any steps that need to be taken towards security at the iPhone stage that I need to be aware of?
May 7, 201214 yr If I want to add lots of info to the database is it just a case of adding each thing to the URL and having a really long URL or is there another way to add the data. Maybe via POST instead of GET. Is there any steps that need to be taken towards security at the iPhone stage that I need to be aware of? I'm no IOS expert so you'd need to consult the IOS developer help docs/forums for best security approcahes. For managing your content database it can be as easy or as hard as you want to make it. If you end up with trying to access long URLs (eg with long query strings) then it could get messy and obvioulsy prone to mistakes. The last site I did used Expressionengine for managing data and pumping out JSON data, this allowed us to set up nicely formatted URL's with a common format so the app could dynamically grab sets of data as it neede: Eg for date based information /data/events - would pull out all "events" /data/events/2012 - would pull out all "events" for 2012 /data/events/2012/02 - would pull out all "events" for Feb 2012 /data/events/2012/02/28 - would pull out all "events" for 28 Feb 2012 Then something like this for other data types /data/articles - would pull out all "articles" /data/articles/recent - would pull out "articles" limted to the most recent /data/articles/date/2012 - would pull out all "articles" from 2012 /data/articles/date/2012/02 - would pull out all "articles" from Feb 2012 /data/articles/entry/41 - would pull out the "article" with ID41 /data/articles/category/fish - would pull out all "articles" in category "fish" /data/articles/user/2 - would pull out all "articles" authored by member ID 2
May 7, 201214 yr Author Ok thanks I'll look into that, I'm just trying to get my head around adding to the db rather than reading. I might need to add up to 20 pieces of info to the db at a time
May 11, 201214 yr Have a look at RESTful APIs. I created a basic one for use with an iPhone app. Not sure how it's done in objective-c but you do POST/GET requests depending on what you want to do.
Create an account or sign in to comment