Using Multiple Hybrid Web Containers on the Same iOS Device

You can configure two or more Hybrid Web Containers to coexist on the same device.

All code areas associated with creating co-existing applications are annotated with IOS_CUSTOMIZATION_POINT_COEXISTING.

This customization allows two or more independent users to use the same device, but with their own private version of the application. In summary, you need to change the application ID, the bundle identifier, and possibly the URL scheme.

The application ID is used by the server to identify the application, and because of this, you cannot run two applications on the same device with the same application ID. By default, the Hybrid Web Container uses “HWC” for its application ID. Changing the application ID involves a minor change to CustomizationHelper.m. Additionally, you must signify to iOS that this is a distinct application. This requires a minor change to a plist file. Finally, if you are using Afaria to provision your application, you need to specify a unique URL scheme. This requires changes to the same plist file.

  1. Change the application ID:
    1. In Xcode Project Navigator, find and open the CustomizationHelper.m file, which is located in the Classes group folder,
    2. Locate the customization point that accompanies the getAppId function, and change it so that it returns a unique name.
    3. Save and close the file.
  2. To differentiate this version of the Hybrid Web Container from another:
    1. In Xcode Project Navigator, find and open the SUPWorkFlows-Info.plist file, which is located in the Resources group folder.
    2. Change the bundle identifier value to something unique.
    3. Save and close the file.
  3. If you are using Afaria to provision your application, you must specify a unique URL scheme for your application.
    1. In Xcode Project Navigator, find and open the CustomizationHelper.m file, which is located in the Classes group folder.
    2. Locate the customization point that accompanies the getAppUrlScheme function, and change it so that it returns a unique name.
    3. In Xcode Project Navigator, find and open the SUPWorkFlows-Info.plist file, which is located in the Resources group folder.
    4. Expand the URL types item, and expand Item 0.
    5. Change the URL identifier value to the value you specified for the Bundle identifier in the previous section.
    6. Save and close the file.
  4. Rebuild the project.