Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

Setup iOS Development Environment

Requirements

  1. Apple OSX development environment.
  2. Download XCode 4.6.
  3. Download PhoneGap 1.70.
  4. Download & run uMobile 1.1RC1 quickstart.

Creating the Project

  1. Open XCode. Choose File > New > Project.
  2. Select Cordova-based Application from the list of templates.
     
  3. Enter the following options on the next screen.

  4. Choose a location for your project.
     
  5. Disable Automatic Reference Counting in the build.
    1. Select uMobile under Targets in the main project view.
    2. Click on the Build Settings tab.
    3. Make sure the All and Combined filters are selected.
    4. Search for reference in the search bar.
    5. Set the Objective-C Automatic Reference Counting property to No.
       
  6. Check the uMobile source out into a new project directory.
     

    git clone git@github.com:Jasig/umobile-app-phonegap  umobile-ui

  7. Run the build process for the uMobile source code. The build process configures the uMobile source code with the necessary dependencies needed to run in a given environment. Currently, the uMobile project supports Android, iOS and Web platforms. Once the build completes a www directory will be added to the umobile-ui directory. The www directory houses the production ready code base to be used with the PhoneGap wrapper.

     cd umobile-ui sudo npm install grunt --environment=iphone

     

  8. Drag the production-ready www directory from your finder window to the XCode uMobile project. When done for the first time, XCode will ask you to create a workspace before including the www directory. For the purpose of this project, we created a umobile workspace.
      
  9. Choose options for adding the www directory to the project.
     
  10. Configure cordova.plist.
    1. In XCode, under the Project Navigator, navigate to uMobile > Supporting Files > Cordova.plist.
    2. Under the Root Key:
      1. Set OpenAllWhitelistURLsInWebView to Yes.
    3. Under the ExternalHosts Key:
      1. Add the hostname, any authentication servers and any other servers hosting uMobile resources.
      2. If you're working with the uMobile quickstart, you can just add localhost.
    4. Under the Plugin Key:
      1. Plugin: SesssionTracking
      2. Type: String
      3. Value: SessionTracking
  11. ...
  1.  

  2. .  Next, add the hostname of your uMobile server, any authentication server, and any other servers hosting uMobile resources to ExternalHosts.  If you're working with the uMobile application server quickstart, you can simply add localhost to the list. Under Plugins add Key: SessionTracking, String: SessionTracking.

  3. Add SessionTracking Plugin files into the Plugins folder: SessionTracking.h and SessionTracking.m

  4. Configure www/config.js.  If you're working with the quickstart, set the value of config.uMobileServerUrl to http://localhost:8080.

  5. Overwrite the file /Classes/MainViewController.m with this one: MainViewController.m

  6. Set the scheme at the top of the project to iPhone 5.1 Simulator and run the project!

Debugging

uMobile logs helpful events and errors.  You can access the log by viewing the console output.

  • No labels