description |
---|
WiiConnect24 functionality, directly within JS |
To send mail via WiiConnect24 and query error code strings, you utilize wiiNwc24
. With mail, you can send normal messages, or gift titles. And via error codes, you can provide a better user experience.
var nwc24 = new wiiNwc24();
Method Name | Discussion |
---|---|
nwc24.getFriendNum() |
Returns the amount of friends on the user's friends list. |
nwc24.getFriendInfo(num, type) |
Queries information about the given friend list entry at num . For all possible type values, see Friends List. |
nwc24.sendGiftMailAsync(friendIndex, urlPath, message, miiIndex) |
Sends a mail using the gift design template with a body of the given |
nwc24.sendReturnMailAsync(friendIndex, message, miiIndex) |
Similar to the above, however lacking the url parameter. The gift return design template is used. |
nwc24.sendNormalMailAsync(friendIndex, message, miiIndex) |
Similar to the above. As the name implies, no mail design template is applied. |
nwc24.isBusy() |
Returns whether the internal mail engine is currently processing an operation. |
nwc24.dispError(code, type) |
Displays an error with
|
nwc24.doLeftBtn() |
Handles function for the button displayed on the left within errors. Depending on the error type, the button either effectively goes to the last loaded page in history, or it resets the channel. |
nwc24.doRightBtn() |
Called whenever the button on the right within error pages is selected. Depending on the error type, it either loads the initially loaded URL (for example, /startup ) or resets the channel. |
You query information about entries within the user's friends list via nwc24.getFriendInfo(num, type)
. There are three available query types:
Query Type | Discussion |
---|---|
name |
Returns the registered name for this friend as a string. |
userId |
Returns the registered friend code as a string. |
miiImage |
Returns a usable character ID for Mii image lookup. For more information, see CID. |
Unlike ECProgress as utilized within EC, Nintendo chose yet another design. Users are expected to repeatedly query nwc24.isBusy()
for
Property Name | Discussion |
---|---|
nwc24.myUserId |
Returns a string with the current console's friend code. |
|
Returns a number with the current registered mail error code. |
nwc24.errCodeWithLabel |
Returns a string with a formatted error code. |
nwc24.errMsg |
Returns a localized string with a description of the error message. |
nwc24.ready |
Returns a boolean on whether an NWC24 error has been set. |
nwc24.sendable |
Determines on whether a message can be sent at call time, i.e. if the scheduler is busy. |
|
Returns a localized string to be displayed on the button within the given side of the page.
For the left button:
|