All Products
Search
Document Center

Mobile Platform as a Service:Customize the city selection

Last Updated:Jul 20, 2023

This article introduces the method of user-defined city selection in the process of integrating mPaaS into iOS client.

When integrating with an iOS project, you can customize the city selection.

Note

This function is valid only in the baseline versions 10.1.68.27 and later.

Customize the city file

All cities

  1. Create a city file with an extension of .txt. The file content format is as follows:

    • Field 1: adcode.

    • Field 2: City name.

    • Field 3: City name in Chinese Pinyin. This field is used to configure the first letter on the right.

  2. Set the path that stores the custom city file. The custom city file is saved under the path of the bundle file, for example, BeeCityPicker.bundle/citiesWithCounty.text. The SDK will automatically read the file name:

    [BeeCityPickerAdapter sharedInstance].customHotCityTextFile = @"BeeCityPicker.bundle/citiesWithCounty.text";

Popular cities

  1. Create a popular city file. The file content is same as the city file created in All cities.

  2. Set the path that stores the custom popular city file.

    [BeeCityPickerAdapter sharedInstance].customHotCityTextFile = @"BeeCityPicker.bundle/hotCities.text";

Customize cities in a mini program

For details about how to customize cities in a mini program, see Select cities.