Resource configuration management is a basic function of Mobile Delivery Service. With this function, you can predefine various configuration data required for Mobile Delivery Service and don’t have to manually input the data every time, with work efficiency improved and error occurrence decreased.
The configuration data, such as city and device model, is also referred to as resources. When adding configuration data, the resource name is shown to users. Only the resource value is used to match request parameters of clients.
On the resource configuration management page, you can perform the following operations:
- Log in to the mPaaS console, and click Mobile Delivery Service > Release rule management from the navigation bar on the left to go to the resource rule management page.
On the release rule management page, click Add resource. In the pop-up window, select resource type and platform type, enter the resource name and resource value, and then click OK to create the resource.
- Resource type: the type of the resource. City, Device Model, Network, and Device System Version are supported.
- Platform type: Select a mobile platform. You can choose Android, iOS, or All.
- Resource name: the name of the resource. You can define the name as needed. The resource name is shown to users and generally consistent with the resource value.
- Resource value: Only one resource value is supported. The following content describes the values of various types of resources:
- City: the name of the city at the prefecture and city level. The name must contain the administrative unit, such as the city, region, autonomous prefecture, league. For example, the name can be Shanghai Municipality, Haidong District, Qiannan Buyi and Miao Autonomous Prefecture, and Xing’an League.
- Model: the model of the mobile device, such as VIVO X5M and iPhone 6S.
- Network: the type of the network. Valid values: 2G, 3G, 4G, 5G, Wi-Fi, and WLAN.
- Device OS version: the system version of the mobile device, such as 10.0.1 and 5.1.1.
If you do not know the model, network, and device system version of the mobile device, you can query the information about the mobile client by calling the specified API. For more information, see Call API operations to query resource configurations.
To modify resource configurations, find the resource and click Modify in the Operation column. Edit the resource configurations as required. Click OK to save the modification.
To delete a resource, find the resource and then click Delete in the Operation column. To delete multiple resources, select multiple resources, click Batch Delete, and then click OK.
When you add a resource, if you do not know the resource values of the network, device model, and device system version, you can call the API to query configurations of the resource.
Perform the following steps:
Open a local project and call the following API to obtain the information of the mobile client:
- Android clients
DeviceInfo deviceInfo = DeviceInfo.createInstance(context);
AppInfo appInfo = AppInfo.createInstance(context);
deviceInfo.getOsVersion(); //The version of the device system.
deviceInfo.getmMobileModel(); //The model of the device.
appInfo.getmProductVersion(); //The version of the device.
int networkType = NetworkUtils.getNetworkType(context);//The network type of the device.
networkType = 1 (2G)
networkType = 2 (3G)
networkType = 3 (Wi-Fi)
networkType = 4 (4G)
- iOS clients
Type Network Device system version (system API) Device model (mPaaS-encapsulated API) Switch configuration None [[UIDevice currentDevice] systemVersion] [APMobileIdentifier shareIdentifier].deviceModel Upgrade detection Wireless networks: Wi-Fi
Mobile networks: WWAN
[[UIDevice currentDevice] systemVersion] [APMobileIdentifier shareIdentifier].deviceModel Hotfix management
Offline package management
Mini Program management
[DTReachability networkName] [[UIDevice currentDevice] systemVersion] [APMobileIdentifier shareIdentifier].deviceModel
Report the client resource information to the server by uploading the log, and then view the resource configuration information on the server.