Comment on page
NWC24
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 message . The recipient is specified by friendIndex from the friends list. The sending user adds their Mii via miiIndex . urlPath is the URL this channel opens to when the Start button is clicked.
Please see Async Handling for more information about the workflow for handling mail errors. |
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 code . There are 3 available types, though they appear ambiguous:
|
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 |
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. |
nwc24.errCode
nwc24.mailErrNo | Returns a number with the current registered mail error code. |
nwc24.errCodeWithLabel | Returns a string with a formatted error code.
For example, assuming a console with its language set to English, one might return "Error code: 123456". |
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.
TODO: Is this fully what the function performs? |
nwc24.sendable | Determines on whether a message can be sent at call time, i.e. if the scheduler is busy.
TODO: Verify logic |
nwc24.leftBtn
nwc24.rightBtn | Returns a localized string to be displayed on the button within the given side of the page.
The button's string is determined from several factors.
For the right button:
For the left button:
|
Last modified 1yr ago