Using Default Connection Settings

You can customize the Hybrid Web Container so that it is pre-populated with connection settings, or to use certain 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.
    This example sets a default value of 5001 for the server port.


    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 project.
Related tasks
Removing Fields from the Settings Screen
Providing Default Values for Missing Connection Settings
Providing Default Connection Settings at Application Startup