Skip to main content

Message Reception Settings

Change the reception settings for push messages.

URL Verification

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

API Information

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

Request Parameters

ParameterTypeRequiredDescription
receive_ynstringRequiredPush message reception status ("Y" or "N")
receive_night_ynstringRequiredNight push message reception status ("Y" or "N")
Night Push

Night push refers to push messages from 09:00 PM to 08:00 AM the next day.

Response Data

FieldTypeDescription
StatusstringProcessing result status

Code Example

void UMyGame::ChangePushSettings(bool bReceive, bool bReceiveNight)
{
// 플레이어 정보가 포함된 요청 바디 생성
TSharedPtr<FJsonObject> Body = FPlayNANOOHelper::CreateRequestBody();
Body->SetStringField(TEXT("receive_yn"), bReceive ? TEXT("Y") : TEXT("N"));
Body->SetStringField(TEXT("receive_night_yn"), bReceiveNight ? TEXT("Y") : TEXT("N"));

// JSON 문자열 변환
FString JsonBody = FPlayNANOOHelper::ToJsonString(Body);

// HTTP 요청
TSharedRef<IHttpRequest> Request = FHttpModule::Get().CreateRequest();
Request->SetURL(TEXT("https://service-api.playnanoo.com/push/v20220701/change"));
Request->SetVerb(TEXT("PUT"));
FPlayNANOOHelper::SetCommonHeaders(Request, true); // 인증 토큰 포함
Request->SetContentAsString(JsonBody);

Request->OnProcessRequestComplete().BindLambda(
[](FHttpRequestPtr Req, FHttpResponsePtr Res, bool bSuccess)
{
if (bSuccess && Res.IsValid())
{
TSharedPtr<FJsonObject> JsonObject;
TSharedRef<TJsonReader<>> Reader = TJsonReaderFactory<>::Create(Res->GetContentAsString());

if (FJsonSerializer::Deserialize(Reader, JsonObject))
{
FString Status = JsonObject->GetStringField(TEXT("Status"));
UE_LOG(LogTemp, Log, TEXT("푸시 설정 변경 성공: %s"), *Status);
}
}
});

Request->ProcessRequest();
}
Real-time Settings Application

Settings changed through this API are immediately reflected on the server and applied from the next push notification.

Token Retention

Changing settings only modifies the reception status without deleting the token. The token remains on the server.

User Experience

It is recommended to provide a push notification settings UI so users can control notifications as they prefer.