In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Editor to share with you how to achieve personalized menus in Wechat official account, I believe most people do not know much about it, so share this article for your reference. I hope you will learn a lot after reading this article. Let's take a look at it!
An example of the Development of Personalized menu in Wechat official account
Personalized menus let different user groups of official accounts see different custom menus. This API is open to authenticated Subscription account and authenticated service number. For personalized menus, the client version of Wechat is required to be above iPhone6.2.2,Android 6.2.4. Currently, other versions of Wechat are not supported. In addition, a default menu must be defined before defining personalized menus.
Developers can set the menu that users see with the following conditions:
User tags (the business needs of developers can be accomplished with the help of user tags)
Gender
Mobile phone operating system
Region (the region set by the user on the Wechat client)
Language (the language set by the user on the Wechat client)
Personalized menu matching rules description:
Updates to personalized menus will be overwritten.
For example, the official account has successively released the default menu, personalized menu 1, personalized menu 2, personalized menu 3. Then when the user enters the official account page, the match will start with the personalized menu 3, and if the personalized menu 3 matches successfully, it will directly return to the personalized menu 3, otherwise continue to try to match the personalized menu 2 until a menu is successfully matched.
According to the above matching rules, in order to avoid confusion about the effective time of the menu, it is decided not to provide personalized menu editing API. When developers need to update the menu, they need to release the complete configuration again.
The project structure of this example is as follows, adding three files that deal with personalized menus in addition to the files in the previous chapter.
Addconditional_menu.php: creating personalized menus
Trymatch.php: test matching personalized menu
Delconditional_menu.php: delete personalized menu
1. Create a personalized menu
The interface for creating personalized menus is https://api.weixin.qq.com/cgi-bin/menu/addconditional?access_token=ACCESS_TOKEN, which sends menu strings in post.
Addconditional_menu.php
The returned result is as follows:
3. Delete personalized menu
Delete personalized menu interface is https://api.weixin.qq.com/cgi-bin/menu/delconditional?access_token=ACCESS_TOKEN, need to post "menuid" past.
Delconditional_menu.php
The returned result is as follows:
4. Query personalized menu
Use the general custom menu query interface to get the default menu and all personalized menu information, see the previous chapter.
The results after the query are as follows:
The menuid here is different from the one above because I deleted the previous personalized menu and reinitialized it.
5. Delete all menus
Use the normal Custom menu Delete API to delete all custom menus (including default menus and all personalized menus).
The above is all the contents of the article "how to realize personalized menu in Wechat official account". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.