Using Default Connection Settings

You can customize the Hybrid Web Container so that it is pre-populated with connection settings, or to use default values if nothing is provided by the user, or to always use default values on startup.

These customizations involve changes to either Root.plist or CustomizationHelper.m.

All code areas associated with removing fields from the Settings screen are annotated with IOS_CUSTOMIZATION_POINT_DEFAULTSETTINGS. The customizations described here assume the Settings screen is used as the interface for providing input from the user. For alternatives to using the default Settings screen, see Removing Fields from the Settings Screen.

  1. In the Xcode project, in the Project Navigator, expand Resources > Settings.bundle and open the Root.plist file.
  2. Expand the item for the settings you want to preset, and fill in the DefaultValue attribute.
    Most settings do not have default values, with the exception of the protocol and the registration method. Because these settings have a "Multi Value" Type in the .plist file (instead of Text Field), they always have a default value that is one of the accepted values listed in Values. You can open the Values tab to see the acceptable values for these settings.
    This example sets a default value of 443 for the server port, and sets the default protocol to HTTPS. The Values item is expanded and shows the acceptable values.


    Note: Pre-populating a value only sets its initial value on a one-time basis; it does not prevent the user from later changing it, nor does it prevent a server change from overwriting it. This approach also cannot be combined with the Removing Fields from the Settings Screen customization because it relies on using the settings bundle.
  3. Save the file.
  4. Rebuild the HWC.xcodeproj project.
    1. From the Xcode menu, select Product > Clean.
    2. Select Product > Build.