Tomorrow is the developing custom mobile Force.com apps for the iPhone and iPad webinar. (Don't forget to register!) One of things I had mentioned previously is that I wrote another sample app designed to offer a very simple introduction to iOS development and the Force.com platform.
This new sample app, designed for the iPhone, demonstrates some of the typical force.com functions you will likely encounter when developing your own apps. Here are a few of the primary requirements, and some code to help you get started.
1. Showing the OAuth Login screen
Add a call similar to [self showLogin] within your didFinishLoadingWithOptions method of your delegate to have the login show immediately upon app startup:
2. Handle oAuth callback
Once the user has authenticated, the platform is going to perform a callback which you will need to handle:
3. Query data in the Force.com database
Here is a simple query to retrieve records and configure a selector, queryResults, to handle the response:
4. Handle the data response.
A typical use case is to present the results in a tableView:
Of course, these code snippets may be hard to follow everything going on if you are not used to Objective-C syntax, but they do demonstrate a pretty common use flow you are likely to encounter as you start building custom iOS apps.
During tomorrow's webinar I'll share some more hints and tips if you are looking at building more mobile apps. Don't forget, Mike Leach from Facebook will also be joining me to offer some insight on how Facebook is approaching mobile development. And with something like 250 million mobile users, Facebook certainly has a pretty big stake in the future of mobile development.