How does a applet know the user's scenario of running a applet?
Preface
Recently, the mini-program team has launched a series of new mini-program functions and expanded the entry points of many mini-programs, which has enriched the running scenarios of mini-programs. Therefore, different scenarios will inevitably bring about different user needs. How can we optimize and improve the experience of our small programs based on these different user scenarios?
The following describes how to know the scenarios in which a user runs a small program and how to use it for your reference. Here is a detailed introduction:
From the very beginning of the basic library API v1.1.0 of the program, the scenario value function was officially introduced. We can get the scenario value in the App entry code of the Applet:
// You can obtain the scenario value App ({onLaunch: function (options) {console in the onLaunch and onShow parameters of the applet. log ("[onLaunch] scenario value:", options. scene)}, onShow: function (options) {console. log ("[onShow] scenario value:", options. scene )}})
Currently, the following scenarios are supported:
1001 search results page in the search box at the top of the main entrance of the applet 1005 1006 1007 search results page in the search box at the main entrance of the applet 1008 in a single chat session program message card 1011 scan QR code 1012 long press picture recognition QR code 1013 mobile phone album select QR code 1014 mini program template message 1017 go to experience edition portal page 1019 wallet 1020 public account profile page related mini program list 1022 chat top Pin applet entrance 1023 Android desktop icon 1024 applet profile page 1025 scan one dimension code 1028 my card pack 1029 coupons details page 1031 long press picture recognition one dimension code 1032 mobile phone album select one dimension code 1034 payment completion page 1035 public account custom menu 1036 App sharing message card 1042 add friend search result page 1043 public account template message 1044 applet message card in group chat session (with shareTicket) 1047 scan small program code 1048 long by Image Recognition small program code 1049 mobile album selection small program code
For example, if the scenario value is 1001, it means that the user runs your applet directly from the "Discover" Page's applet Portal:
Scenario 1001
For this scenario value data, I think whether it is used to improve the targeted functions of small programs or as a reference for precision market operation, it is very valuable information.
Summary
The above is all the content of this article. I hope the content of this article will help you to learn small programs. If you have any questions, you can leave a message, thank you for your support.