Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What about the new button developed by Wechat Times wrong errcode 40054?

2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article will explain in detail about the new button on Wechat development Times wrong errcode 40054 how to do, the editor thinks it is very practical, so share it with you as a reference, I hope you can get something after reading this article.

When Wechat develops the button for the new official account, the error is as follows:

{errcode:40054,errmsg: "invalid sub button url domain"}

After careful investigation, it is found that the url address is in the wrong format:

WXButton button = new WXButton (); button.setName ("baidu"); button.setType ("view"); button.setUrl ("www.baidu.com"); WXButton button2 = new WXButton (); button2.setName ("customer Service MM"); button2.setType ("view") Button2.setUrl ("www.baidu.com"); WXButton button3 = new WXButton (); button3.setName ("help"); button3.setType ("view"); button3.setUrl ("www.baidu.com")

Here button.setUrl ("www.baidu.com"); should be changed to: button.setUrl ("http://www.baidu.com");")

Be sure to wear the http prefix, or you will report an error {errcode:40054,errmsg: "invalid sub button url domain"}.

The relevant WXButton.java code is as follows:

Public class WXButton {response action type of the private String type; / / button menu. This field can never be empty private String name; / / button menu title, no more than 16 bytes, no more than 40 bytes of submenu, and this field can never be empty private String key. / / the key of the event when the button is clicked. This field cannot be an empty private String url; / / web link in click and other click types. Users can click the menu to open the link, which does not exceed 256bytes. This field cannot be empty private WXButton [] sub_button in view type. / / Sub-buttons (up to secondary buttons, up to three first-level buttons, and up to five secondary buttons under each first-level button) public String getType () {return type;} public void setType (String type) {this.type = type } public String getName () {return name;} public void setName (String name) {this.name = name;} public String getKey () {return key;} public void setKey (String key) {this.key = key } public WXButton [] getSub_button () {return sub_button;} public void setSub_button (WXButton [] sub_button) {this.sub_button = sub_button;} public String getUrl () {return url } public void setUrl (String url) {this.url = url;}} this is the end of the article on "what to do with the New Button of Wechat Development Times wrong errcode 40054". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report