Skip to main content

Friend Request

Sends a friend request to a player. Automatic approval of the request depends on the friend table settings.

Call Information

FriendRequest(String friendCode, String friendOpenId, PlayNANOODelegate callback) {}

Call Information Details

ParameterDescriptionType
friendCodeFriend table identification codestring
friendOpenIdFriend player's OPEN ID
OPEN ID is provided by the connection event service.
PlayNANOODelegate
callbackCommunication resultPlayNANOODelegate

Source Code

using PlayNANOO;

public class PlayNANOOExample : MonoBehaviour
{
Plugin plugin;

void Awake()
{
plugin = Plugin.GetInstance();

string friendCode = "string";
string friendOpenId = "string";
plugin.FriendRequest(friendCode, friendOpenId, (state, message, rawData, dictionary) => {
if(state.Equals(Configure.PN_API_STATE_SUCCESS)) {
Debug.Log("Success");
} else {
Debug.Log("Fail");
}
});
}
}

Communication Result

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"code" : 200,
"message" : 0,
"value" : []
}