...
- In a Terminal window, navigate to your project location. For this tutorial, our project is housed under the Documents > umobile-phonegap-ios directory.
From this directory, checkout the uMobile source code.
Code Block git clone git@github.com:Jasig/umobile-app-phonegap umobile-ui
- Your project directory should look similar to the below graphic:
- ...
Creating the Project
A completed example of an XCode project configured to run the uMobile PhoneGap implementation is available on github.
Check the uMobile source out into a new project directory.
Configure the uMobile Source
- In a Terminal window, navigate to your project location. For this tutorial, our project is housed under the Documents > umobile-phonegap-ios directory.
- In the same Terminal window, navigate to the umobile-ui directory.
Execute the following command to load all the ui dependencies. Note: Node must be installed.
Code Block sudo npm install
- 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 local.js.
- Open local.js.
- Set config.uMobileServerUrl to http://localhost:8080.
- Set config.loginFn to localLogin.
- 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.
Code Block grunt prod --environment=ios --auth=local
- ...
Creating the Project
- Navigate to umobile-ui/config/js.
- 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.
cd umobile-ui sudo npm install grunt --environment=ios --config=cas --build=prodCode Block - 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.
- Choose options for adding the www directory to the project.
- Configure cordova.plist.
- 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 SessionTracking Plugin files into the Plugins folder:
- Download MainViewController.m
- Navigate to uMobile > Classes > MainViewController.m.
- Replace MainViewController with the downloaded version.
- Set the scheme at the top of the project to iPhone 6.1 Simulator and run the project!
...