Setup iOS Development Environment
Status | ||||
---|---|---|---|---|
|
- Apple OSX development environment.
- Download XCode 4.6.
- Download PhoneGap 2.50.
- Download & run uMobile 1.1RC1 quickstart.
- Download & install node.
- Node is used to automate the build process for our JavaScript, HTML and CSS assets.
- Node is installed locally and is leveraged for convenience.
- Node v0.8.12 is recommended for this documentation.
...
- Navigate to the umobile-ui/config directory.
- Open the config.json file in an editor of your choice.
Set the external property to the path of your root project's www file directory. See the below code snippet for an example. The external property tells the build process where we want to push production-ready code. In this instance, we are telling it to place our production-ready code in the www container provided by the PhoneGap code base. Note: It is important to point out that while we have the capability to push production-ready code to an external source, we do not have the ability to clean or remove previously pushed code that lives outside of the umobile-ui directory. This is a limitation of the grunt libraries being leveraged on this project. Future updates to this code base could improve this functionality.
Code Block { "port": 5000, "environment": "web", "auth": "mock", "mode": "dev", "less": { "dest": "./src/css", "src": "./src/less", "prefix": "/css", "debug": true }, "external": "../../www" }
Run the Build
- In a Terminal window, navigate to the umobile-ui directory.
Execute the below command in the Terminal window.
Code Block grunt prod --environment=ios --auth=local
The above command starts 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. Please see the documentation on the uMobile HTML5 build for more information on configuring the build script.
Once built, execute the below command to push the built code to the PhoneGap www directory.
Code Block grunt push.prod
- Your project directory should like similar to below graphic:
Creating the Project
...
...
- uMobile currently supports three different authentication strategies: CAS, Local & Mock.
- Each strategy has a cooresponding configuration file under the umobile-ui/config/js directory (i.e., cas.js, local.js and mock.js).
- Choose one of the three authentication strategies. For this documentation, we will use cas.js.
- Open cas.js.
- Set config.uMobileServerUrl to http://localhost:8080.
- Set config.loginFn to casLogin.
- Note: There are bugs with the current login functionality. Only view the portal using the guest layout. This is being addressed.
- Set config.uMobileServerUrl to http://localhost:8080.
...
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. Please see the documentation on the uMobile HTML5 build for more information on configuring the build script.
...
- In XCode, under the Project Navigator, navigate to uMobile > Supporting Files > Cordova.plist.
- Under the Root Key:
- Set OpenAllWhitelistURLsInWebView to Yes.
- Under the ExternalHosts Key:
- Add the hostname, any authentication servers and any other servers hosting uMobile resources.
- If you're working with the uMobile quickstart, you can just add localhost.
- Under the Plugin Key:
- Plugin: SesssionTracking
- Type: String
- Value: SessionTracking
...
...
Add uMobile Icons and Splash Screens
The uMobile source code ships with iOS icons and splash screens. Currently, these splash screens and icons have not been designed for the new high-retina displays. Future work on the uMobile source code should focus on updating these icons and splash screens for high-retina displays.
- In the Finder, navigate to your project location. For this tutorial, our project is housed under the Documents > umobile-phonegap-ios directory.
- All icons and screens can be found at the following path: umobile-phonegap-ios > src > images > platform > ios
- Update the images within the ios folder to match your organization or institution.
- Copy all the icons from ios directory to the umobile-phonegap-ios > uMobile > Resources > icons directory.
- Copy all splash screens from the ios directory to the umobile-phonegap-ios > uMobile > Resources > splash directory.
Start the uMobile Server
- The requirements section of this documentation states that you need to download and start the uMobile quickstart (i.e., uMobile 1.1RC1). The uMobile quickstart houses all the content leveraged by the uMobile application for this tutorial. For more information on the uMobile quickstart visit the project's main site.
Once the uMobile server is downloaded and extracted. Navigate to the root folder and execute the following command:
Code Block ant start
Run uMobile with the iOS Simulator
- In Finder, navigate to your project location. For this tutorial, our project is housed under the Documents > umobile-phonegap-ios directory.
- Double click the uMobile.xcodeproj file. This will open the xCode editor.
- Set the scheme at the top of the project to iPhone 6.1 Simulator and run the project!
uMobile Screen Shots
Gallery | ||||||
---|---|---|---|---|---|---|
|
Debugging
uMobile logs helpful events and errors. You can access the log by viewing the console output.