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!