Error "errcode40054" is reported when the "create" button of WeChat development is used.

Source: Internet
Author: User
When the developer creates a public account, the following error is returned: {errcode: 40054, errmsg: & quot; invalidsubbuttonurldomain & quot:

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

After careful troubleshooting, it is found that the url address format is incorrect:

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 ");

Make sure to include the http prefix. Otherwise, the error {errcode: 40054, errmsg: "invalid sub button url domain"} will be reported "}

The WXButton. java code is as follows:

Public class WXButton {private String type; // response action type of the button menu. This field cannot be empty private String name; // The title of the button menu, no more than 16 bytes, the sub-menu cannot exceed 40 bytes. This field cannot be empty private String key; // Click the key of the current event, the click type of this field cannot be empty private String url; // webpage link. you can click the menu to open the link, which consists of no more than 256 bytes, this field cannot be empty in the view type. private WXButton [] sub_button; // subbutton (a maximum of two buttons are available, and a maximum of three buttons are available at the first level, A maximum of five level-2 buttons under each level-1 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 ;}}

For more information about how to create a development button, the error errcode 40054 is reported. For more information, see PHP!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.