It is in our pipeline and our next release will have all the APIs.
For now, you can add below written method in PushNotificationService class:
In PushNotificationService.h:(cocos2d-x version 2.2.2)
void DeleteDeviceToken(string deviceToken, string userName, CCObject* pTarget, cocos2d::SEL_CallFuncND pSelector);
In PushNotificationService.cpp:(cocos2d-x version 2.2.2)
void PushNotificationService::DeleteDeviceToken(string deviceToken, string userName, CCObject* pTarget, cocos2d::SEL_CallFuncND pSelector)
{
App42PushNotificationResponse *response = new App42PushNotificationResponse::App42PushNotificationResponse(pTarget,pSelector);
try
{
Util::throwExceptionIfStringNullOrBlank(userName, "User Name");
Util::throwExceptionIfStringNullOrBlank(deviceToken, "Device Token");
Util::throwExceptionIfTargetIsNull(pTarget, "Callback's Target");
Util::throwExceptionIfCallBackIsNull(pSelector, "Callback");
}
catch (App42Exception *e)
{
std::string ex = e->what();
response->httpErrorCode = e->getHttpErrorCode();
response->appErrorCode = e->getAppErrorCode();
response->errorDetails = ex;
response->isSuccess = false;
if (pTarget && pSelector)
{
(pTarget->*pSelector)((cocos2d::CCNode *)pTarget, response);
}
delete e;
e = NULL;
return;
}
/**
* Creating SignParams and signature
*/
map<string, string> signParams;
string timestamp = Util::getTimeStamp();
populateSignParams(signParams);
signParams["userName"] = userName;
signParams["deviceToken"] = deviceToken;
string signature = Util::signMap(secretKey, signParams);
/**
* Creating URL
*/
string resource = "push";
string baseUrl = getBaseUrl(resource);
baseUrl.append("?");
/**
* Creating Query Params
*/
map<string, string> queryParams;
queryParams["userName"] = userName;
queryParams["deviceToken"] = deviceToken;
string queryString = buildQueryString(queryParams);
baseUrl.append(queryString);
/**
* Creating Headers
*/
std::vector<std::string> headers;
map<string, string> metaHeaders;
populateMetaHeaderParams(metaHeaders);
Util::BuildHeaders(metaHeaders, headers);
Util::BuildHeaders(apiKey, timestamp, VERSION, signature, headers);
/**
* Initiating Http call
*/
Util::executeDelete(baseUrl, headers, response, callfuncND_selector(App42PushNotificationResponse::onComplete));
}