2

I'm writing a backend for my iPhone app and I'm looking for tutorials or sample code for writing the backend.

I'm using RestKit as the client. so it would be using JSON and a RESTful framework.

Thanks.

My main problem is that I don't know how to translate the request from the iPhone to return the corresponding objects and how to translate those models to JSON in the backend.

Will Hartung
  • 115,893
  • 19
  • 128
  • 203
Tomer Even
  • 4,820
  • 2
  • 30
  • 36
  • What's your server environment? I assume you're asking about writing the web service here. –  Sep 17 '11 at 11:23
  • I'm not sure i fully understand your question but I've started exploring RECESS although I'm still thinking of using a ruby on rails server... as you can see I'm new to web developing – Tomer Even Sep 17 '11 at 11:26
  • JSON and REST suggest that you want your iPhone app to talk to a server somewhere (using REST with a JSON format). How the server is set up is completely up to you (you can use PHP, .NET, JSP, whatever...), so until you decide that no tutorial will tell you what you need to know. –  Sep 17 '11 at 11:31
  • I prefer PHP but as i said ruby on rails is an option too – Tomer Even Sep 17 '11 at 11:49

4 Answers4

3

I would check out StackMob. Their platform helps you build a complete backend to your mobile app. They provide core services you'll want from your backend (secured REST API, Custom Code, Push Notifications, Facebook & Twitter log in and more). They also help on the deploy side with clear development and deployment environments along with easy and organized versioning. And they help with the technical (handle growth/spikes in data/traffic) & business (analytics from the server & client side) scaling of your app. http://www.stackmob.com/product/

2

PHP is pretty nice with the built in JSON

<?php

    $data = file_get_contents("php://input");

    $jsondata = json_decode($data);

    $result = array();

// *****************************************************************
// do something with $jsondata and put the results in $result
// *****************************************************************

    $result['success'] = true;
    $result['message'] = "Call Successful!";

    echo json_encode($result);
?>
Daniel Broad
  • 2,512
  • 18
  • 14
1

IF you want to write web service in ruby on rails then use Objective Resource It has iphone project and backend in ruby on rails

iProgrammer
  • 3,099
  • 3
  • 33
  • 59
0

Now you don't need to write server side for you mobile applications (iOS, Android, Blackberry, WindowsPhone...), there are lots of free custom backends. I used QuickBlox custom backend in some my apps, there is great Custom Objects module with lots of features.

Look at iOS custom objects sample code example. It shows how to:

  • Create own server data structure & use it.
  • Get, Create, Update, Delete your data using a lot of filters.

Just download & run. Maybe it's all what you need.

Don't write server side code, save your time & money!)

Rubycon
  • 18,156
  • 10
  • 49
  • 70