preface

Recently, when the project was launched, there was a problem that it could not be put on the shelves. Because of the permission problem of UNI-App, APP Bao and others could not pass the approval of putting on the shelves.

The solution

According to the official solution of UNI-App, the configuration of offline packaging is explained in the official article. Make the following excerpt:

Configure the privacy providing box mode in androidmanifest.xml applied in the native project, and add meta-data node data under the application node as follows:

<meta-data  android:name="DCLOUD_PRIVACY_PROMPT"  android:value="template"/>
Copy the code

Android :value Can be “template”, “custom”, or “None”.

On the key

To configure the template prompt box, perform the following steps: Configure the default language content in the strings. XML file in the res/values directory of the native project (this file must be configured to allow users to delete information in different languages). You also need to create the strings. XML file in the res/values-zh directory and configure the Chinese content.

Note that you need to create a new one

res/values-zh/strings.xml
Copy the code

Template Prompt box

Add the following fields to the strings. XML file of the native project to configure the template prompt box.

<resources> <string name=" dcloud_privacy_PROMPt_title "> Popup title </string> <string Name =" dcloud_privacy_PROMPt_accept_button_text "> Receive button text configuration field (this field does not exist, </string> <string name=" dcloud_privacy_PROMPt_refuse_button_TEXT "> Reject button text configuration field (there is no such field or the field is empty, Reject button not displayed) </string> <string name=" dcloud_privacy_PROMPt_message "><Data><! [CDATA]></Data></string> </resources>Copy the code

A confirmation dialog box is displayed

HBuilderX3.1.12+ added the second confirmation function for template privacy prompt box. When clicking the privacy prompt box, users click “Reject” and confirm the content of the second confirmation box. Dcloud_second_privacy_prompt_message If the configuration is not empty, a second confirmation box will be displayed.

Add the following fields to the strings. XML file of the native project to configure the contents of the second confirmation dialog box.

<string name=" dcloud_second_privacy_PROMPt_title "> Title of the secondary pop-up </string> <string Name =" dcloud_second_privacy_PROMPt_accept_button_text "> Receive button text configuration field (this field does not exist, </string> <string name=" dcloud_second_privacy_PROMPt_message "><! [CDATA[protocol content]]></string> <string name=" dcloud_second_privacy_PROMPt_refuse_button_text "> Reject button text configuration field (there is no such field or the field is empty, </string>Copy the code

Privacy agreement content needs attention

It is necessary to inform users that your application is developed based on DCloud Uni-app (5+ APP /Wap2App) in the Privacy Policy and add the following reference terms:

Our product is developed based on DCloud Uni-app (5+ app /Wap2App). During the operation of the application, you need to collect your unique device identification code (IMEI/ Android ID/DEVICE_ID/IDFA, SIM card IMSI information) to provide statistical analysis services. In addition, application startup data and exception error log analysis are used to improve performance and user experience and provide better services for users.

  • Privacy Policy template. Zip

Customize permissions to get pop-up content

Offline packaging prompt configuration and popup configuration.

Prompt configuration

Add the following fields to the strings.xml of the main project. Strings. XML is located in the project directory/SRC /main/res/values. If the file or folder does not exist, create it.

Storage permission prompt configuration

<resources> <string name="dcloud_permission_write_external_storage_message"> Storage permission hint </string> </resources>Copy the code

Read mobile phone status permission configuration

<resources> <string name="dcloud_permission_read_phone_state_message"> </string> </resources>Copy the code

Popup window configuration

Add the following fields under the Application node of androidmanifest.xml.

Storage permission popup configuration

<application>  
    <meta-data android:name="DCLOUD_WRITE_EXTERNAL_STORAGE" android:value="once"/>  
</application>  
Copy the code

Value The value can be none, once, or always.

Read the phone status popup configuration

<application>  
    <meta-data android:name="DCLOUD_READ_PHONE_STATE" android:value="once"/>  
</application>  
Copy the code

Value The value can be none, once, or always.

supplement

It turns out that some developers are calling plus.device.getInfo in main.js.

But actually the API operations has nothing to do with permissionExternalStorage Settings, permissionExternalStorage application is used to set the internal logic is SD card to apply for access

Developers because when start to call API to trigger the permissions apply, mistook permissionExternalStorage setting (actually setting is effective).

Other API operations will apply for permission based on functional requirements. For example, the operating system album will apply for permission to access the SDK card, and location operations will apply for location permission.

How to configure the Privacy and Policy prompt box on the Android platform

Privacy protocols for each SDK

Application Compliance Guide for Uni-App (5+ APP) on Android App Market and solution for receiving compliance rectification notice from MiIT or App market