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.
- In the Xcode project, in the Project Navigator, expand and open the Root.plist file.
- 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.
- Save the file.
- Rebuild the HWC.xcodeproj project.
- From the Xcode menu, select .
- Select .