This is quite a simple iPhone app, it should behave very much like a browser.
1) the user starts the app. Display: welcome message with a text field where an access code is to be inserted and a Submit button. Optionally, if the user has already successfully inserted his code during a previous session, the text field should already contain that same code (the field is always editable).
2) on Submit click the app connects via HTTP to our servers and tries to authenticate with the inserted code. The server shall respond with either ANSWER1 (a KO) or ANSWER2 (an OK).
3) IF the server DOES NOT RESPOND in X time, the user sees a static timeout page (i.e. "service unavailable, please try again later") with the option to go back to the welcome page and insert the code again, or to close the application.
4) IF the server responds with ANSWER1, the user sees a "promotional" page with the info received from the server in ANSWER1. The page also gives the option to go back to the welcome page and insert the code again, or to close the application.
5) IF the server responds with ANSWER2, the user sees a "personal" page with the info received from the server in ANSWER2. The page further displays a text field (SenderID - if possible, the default value is the iPhone phone number, but it also has to be fully editable), a second editable text field (DestinationID) and a Connect button. The page also gives the option to go to the users' iPhone address book and to search and select a stored phone number and to insert it in the DestinationID field, or to close the application altogether.
6) On click Connect button, the app presents the user with a confirm page (all data previously inserted: SenderID, DestinationID): options are OK (Submit data via HTTP to our servers) and Cancel (go back to "personal" page to edit data).
7) On OK click (data is submitted to server), the server responds with an OK and the user sees the "thank you" page, with only the option to close the application. IF the server DOES NOT RESPOND in X time, the user sees a static timeout page (i.e. "service unavailable, please try again later") with the option to go back to the welcome page and insert the code again, or to close the application.