Skip to main content

Token Deletion

Deletes the user push token registered on the server.

URL Verification

This API uses the service-api.playnanoo.com domain.

API Information

  • URL: https://service-api.playnanoo.com/push/v20220701/remove
  • Method: PUT
  • Authentication Required: Yes
DeviceInfo Inheritance

The Req class of this API inherits from DeviceInfo. All properties of DeviceInfo are automatically included.

Request Parameters

This API does not have additional request parameters.

Response Data

Res Class

FieldTypeDescription
StatusstringProcessing result status

Unity C# Implementation

BaseResponse Class

The base class for all API responses.

public class BaseResponse
{
public string ErrorCode;
public string Message;
public string WithdrawalKey;
public string BlockKey;
}

Field descriptions:

  • ErrorCode: Error code
  • Message: Error message
  • WithdrawalKey: Key required for recovery if in withdrawal grace period (provided only for accounts in withdrawal grace period)
  • BlockKey: Key provided for blocked accounts (provided only for blocked accounts)

Push Token Deletion Class

using System;
using System.Collections;
using UnityEngine.Networking;

public class PushRemove
{
static string url = "https://service-api.playnanoo.com/push/v20220701/remove";

[Serializable]
public class Req : DeviceInfo
{
public IEnumerator Send(
Action<Res> onSuccess,
Action<BaseResponse> onError)
{
// PUT method call
yield return HttpClient.Send<Req, Res>(
UnityWebRequest.kHttpVerbPUT,
url,
requireToken: true,
body: this,
onSuccess: onSuccess,
onError: onError
);
}
}

[Serializable]
public class Res : BaseResponse
{
public string Status;
}
}

Usage Example

using PlayNANOO;

public class PlayNANOOExample : MonoBehaviour
{
void Start()
{
RemovePushToken();
}

void RemovePushToken()
{
PushRemove.Req req = new PushRemove.Req();

StartCoroutine(req.Send(
onSuccess: res =>
{
Debug.Log($"Push token deleted successfully: {res.Status}");
},
onError: (error) =>
{
Debug.LogError($"Failed to delete push token: [{error.ErrorCode}] [{error.Message}]");
}
));
}
}
Token Deletion Timing

You can call this API to remove the push token from the server when a user logs out or completely disables push notifications.

Re-registration Required

To receive push notifications again after deleting the token, you must re-register through the token save API.

Use Cases
  • When user logs out
  • Cleanup before app deletion
  • When completely disabling push notifications