问题
I have deployed IBM Worklight Application Center on WebSphere Liberty profile. I have then also installed the client app in my mobile device. However, the first time I open the client it asks for server login details, such as: username, password, server address, port, context, etc.
I would like to know if it is possible to fill the server and port fields with default values.
回答1:
Yes, it is possible. You have several ways to handle what you're asking for.
Since you also have the project source code, you can customize it. That is, alter the HTML so that the text fields will contain default values.
It is also possible to customize these values using a config.json file in the App Center's Worklight project:
url
The hardcoded address of the Application Center server. If this property is set, the address fields of the Login view are not displayed.defaultPort
If the url property is null, this property prefills the port field of the Login view on a phone. This is a default value; the field can be edited by the user.defaultContext
If the url property is null, this property prefills the context field of the Login view on a phone. This is a default value; the field can be edited by the user.
You can read more here:
- Application Center parent topic @ IBM Worklight Information Center
来源:https://stackoverflow.com/questions/19776114/ibm-worklight-how-to-set-default-values-for-the-app-center-client-app