uni-app WeChat Mini Program - Improving User Privacy Protection Guidelines - (chooseAndUploadFile:fail api scope is not declared in the privacyaereemen

Preface

  • Recently, I suddenly discovered that the uni-app upload component cannot open the file resource and reports an error when uploading images in the WeChat developer tool.

  • In the trial version and the online version, the situation is the same. When uploading pictures, the camera and album cannot be opened, and the same error is reported.

  • In fact, this is because the mini program backend does not have complete user privacy protection guidelines and corresponding API and component application permissions.

  • In the process of querying this problem, I found many people saying that components were uploaded manually, settingsusePrivacyCheck, changes to the basic library, etc.

  • I am getting more and more confused when troubleshooting the problem later - here is the process of solving this problem myself to share with everyone.

The scene is now

  • When uploading components in WeChat developer tools, an error occurs and the file resource cannot be opened.

  • If you change the mini program base library to 2.32.2 - everything is normal, it means that your user privacy protection guidelines are not perfect.

  • It is not advisable to change the basic library yourself (will be discussed below)

Process instructions

1. Do you need to add the mini program attribute in the source code view of uni-app?usePrivacyCheck: true-not required
  • First, Mini Program Document Search - Mini Program Privacy Agreement Development Guide

  • The document makes it very clear that after September 15, 2023, regardless of whether you have set this attribute or not, the privacy inquiry pop-up box will be turned on.

2. Does the uni-app uni-file-picker component require upload space - enable manual upload - not required
  • Come to the built-in uni-file-picker component of uni-app documentation

  • The document says it very clearly - when there is no upload space, the default is to upload manually - which means it doesn't matter (there are specific articles on the home page)

  • This means that if your component is used normally, it has nothing to do with it.

3. After changing the WeChat developer tool base library to 2.33.2, everything will be normal - not advisable
  • We can understand the basic library of the mini program as the WeChat version, which will change according to the different WeChat versions installed.

  • Because if you modify the basic library in the native developer tools, you can indeed upload images normally.

  • And after the basic library is pushed, you will find that you can only log in to the trial version using your mobile phone environment, and the official version can be uploaded normally - but it will mislead us.

  • Because we push the basic library locally, we can only change the basic library of our own WeChat environment. We cannot change the basic library used by others.

  • This is also why only the minimum basic library reminder can be set in the background of the mini program - because we cannot prevent others from updating

  • Therefore, improving user privacy guidelines and obtaining authorization are the real solutions.

4. Why is it so strict and safe - understand it yourself
  • User privacy guidelines mean to control relevant important components and APIs. Developers can apply for corresponding permissions if they need to use them - users will also be notified through pop-up windows.

  • Probably for the sake of data security and user notification - users must know what we do

  • Including the obsolescence of the previously authorized API and the inability to use other components and APIs. This is probably the reason - understandable

WeChat mini program background notification

Solution steps

1. Log in to the mini program management background - click Settings at the bottom on the right - scroll down under Basic Settings to find - Service Content Statement

  • If it has not been modified once, it has not been updated. If it has been modified once, it has been updated.

2. Click Update on the right side - 1. Information processed by developers - Add information type - Make sure to see clearly, do not just swipe down to directly confirm the generated agreement

  • Check the correct information type permissions according to the API used in your code

  • How to know which permissions the API corresponds to - click on the picture - or search the document directly - Introduction to the Mini Program User Privacy Protection Guidelines

  • Mine is about uploading - collecting the photo or video information you selected - accessing your camera (just fill in the purpose)

  • The review usually takes a few hours to pass.

3. Select the corresponding permissions and you will be sure to fill in the purpose of each permission - just fill it in truthfully - it is for the user to see.

4. Complete the form and move to the bottom - confirm and generate the agreement - waiting for review

5. After passing the review - local WeChat developer tools or any basic library - uploading images returns to normal

  • And it will automatically detect it. When you need to obtain user privacy guidelines, the authorization box will pop up to confirm (it will only appear once)

  • After we recompile locally, an authorization box will also appear. The content of the agreement is what we checked and applied for review in the background of the mini program.

6. At this time, we only ensure that the local environment is normal - so when submitting the trial version for review, check the box to collect user privacy.

   Please click Update to check the message type to see if it is consistent. If not, repeat steps 2, 3, and 4 above.

   The background settings of the mini program are local, and clicking here to update is pipelined. You need to set it twice for the first time (remember)

7. Final effect

  • The applet pulls up an authorization box when uploading pictures (User Privacy Guidelines - Authorization will only occur once) and everything is normal after confirmation.

  • end


Summarize:

After going through this process, I believe you will also have a deep initial impression of the uni-app WeChat applet - Improving User Privacy Protection Guidelines - (chooseAndUploadFile:fail api scope is not declared in the privacy aereement), but in actual development we The situations we encounter are definitely different, so we must understand its principles and never deviate from its principles. Come on, hit the workers!

Please point out any deficiencies, thank you - Feng Guo Wuhen

Supongo que te gusta

Origin blog.csdn.net/weixin_53579656/article/details/134084927
Recomendado
Clasificación