

English
In order to reduce system resource consumption on the iOS platform, the application does not support running in the background by default, and switching to the background will stop running. For example, when the app switches to the background, the music will be paused, and the next time it switches to the foreground, it will continue to play. If the application switches to the background to continue running functions such as playing music, positioning, etc., it needs to configure the ability to support background running.
The following capabilities are supported:
Visual interface configuration
Note: "audio" indicates the ability to play music in the background, and "location" indicates the ability to locate the background. For more background capability configurations, refer to Apple's official website UIBackgroundModes document ; Multiple background capabilities are split using ","; If the visual interface cannot be edited, please switch to the "source view" to delete the
UIBackgroundModes
node data and re-operate.
Source view configuration Open the manifest.json file of the project, switch to the "source view", and configure according to the project type
"app-plus": {
"distribute": {
"ios": {
"UIBackgroundModes": "audio,location"
//...
},
//...
},
//...
},
//...
"plus": {
"distribute": {
"ios": {
"UIBackgroundModes": "audio,location"
//...
},
//...
},
//...
},
//...
Note: For backward compatibility, the
UIBackgroundModes
property value supports a string array when configuring the HBuilderX source view. The value in the above example can also be configured like this ["audio","location"]
Submit the App cloud package to take effect after saving