nn::friends::CTR::AddFriendWithApproach Function

Syntax

Result AddFriendWithApproach(
     os::Event * pEvent,
     const ApproachContext & approachContext
);

Parameters

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.

Return Values

Returns the result of the operation.

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.

Description

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.

Revision History

2012/04/24
Removed ResultMiiNotExists from the Return Values and added ResultInvalidPreference.
2012/03/12
Added a note about removing cards.
2012/02/16
Added a note about stopping and restarting the debugger.
2012/01/05
Changed the text "offline friend" to "local friend."
2011/12/16
Initial version.

CONFIDENTIAL