nn::friends::CTR::AddFriendWithApproach FunctionResult AddFriendWithApproach( os::Event * pEvent, const ApproachContext & approachContext );
| Name | Description | |
|---|---|---|
| in | pEvent |
Specifies a pointer to nn::os::Event, which signals that asynchronous processing is complete. Initialize this ahead of time, using the nn::os::Event::Initialize function. |
| in | approachContext |
Specifies the approach context of the user to register as a friend. |
| Value | Description |
|---|---|
Result::IsSuccess |
Process succeeded. |
ResultInvalidPointer |
Invalid pointer passed as argument. |
ResultInvalidHandle |
Invalid nn::os::Event handle passed as argument. |
ResultNotInitialized |
The friend presence library is not initialized. |
ResultFriendNumMax |
The friend list is full. |
ResultInvalidPreference |
Not configured in the privacy settings for the friend list first-time startup sequence. |
ResultAddFriendProhibited |
Adding a friend is prohibited by Parental Controls. |
ResultInvalidPrincipalId |
Attempted to register an approach context with the same principal ID as the local host. |
| Other | Another result may be returned, depending on the internal state of the daemon and other factors. |
Adds a user that includes an approach context to the friend list.
If this function returns successfully, asynchronous processing begins. The event nn::os::Event specified in the argument is signaled when asynchronous processing completes. Call the nn::friends::CTR::GetLastResponseResult function to get the result of the asynchronous operation. If this function fails, no asynchronous processing occurs.
When this function completes successfully, the registered user becomes a local friend.
When using this function to add a friend, implement with a sequence so that both users must agree, and then each user is registered as a friend of the other user.
Before using this function, you must first call nn::cfg::CTR::Initialize to initialize the CFG library.
If you stop or restart the debugger immediately after a friend has been added, you might lose the content you just added. The same goes for transitioning from the card-removal screen to the HOME Menu on systems, including test (system) units. Wait around 15 seconds after adding a friend before conducting debugger operations. You do not need to take this into consideration when powering down systems the normal way or exiting applications.
ResultMiiNotExists from the Return Values and added ResultInvalidPreference.CONFIDENTIAL