Force.com Contact Apex HTML5 Iphone App
This is part 2 of the tutorial so make sure you have completed Part 1:
We will now create a Hybrid Iphone App.
Step 1. Create a new remote access setting by navigating to Setup-> Developer -> Remote Access. Create a remote access by specifying a callback URL:
Note: Remember the newly created consumer key cause you will use it the bootstrap.js file.
Step 2. Download and Install the Salesforce iOS SDK
Step 3. Open XCode and create a new Force.com Hybrid App
Step 4. Delete the www folder and replace with file attached. Replace with the new www file which you can download from:
Step 5. Navigate to the bootstrap.js file and edit the following settings
var debugMode = true; // The client ID value specified for your remote access object that defines // your application in Salesforce. var remoteAccessConsumerKey = "###"; // The redirect URI value specified for your remote access object that defines // your application in Salesforce. var oauthRedirectURI = "sfdc://success"; // The authorization/access scope(s) you wish to define for your application. var oauthScopes = ["visualforce","api"]; // The start page of the application. This is the [pagePath] portion of // http://[host]/[pagePath]. Leave blank to use the local index.html page. var startPage = "apex/SalesKing"; // Used for local REST-based"index.html" PhoneGap app. //var startPage = "apex/BasicVFPage"; //used for Visualforce-based apps // Whether the container app should automatically refresh our oauth session on app foreground: // generally a good idea. var autoRefreshOnForeground = true;
Step 6: Run your application. It will prompt you to login to Salesforce using your Salesforce username and password.
Step 7. It will ask to allow or deny access to the application you specified in step 1. Click ‘Allow’ to access the application.