본문으로 건너뛰기

데이터 저장

일반 데이터를 저장 합니다.

호출 정보

CacheSet(String dataKey, String dataValue,  Integer dataTtl, PlayNANOODelegate callback) {}

호출 상세 정보

파라미터설명타입
dataKey캐시 데이터 키string
dataValue캐시 데이터 값string
dataTtl캐시 데이터 만료 시간 (초단위)integer
callback통신 결과PlayNANOODelegate

소스 코드

using PlayNANOO;

public class PlayNANOOExample : MonoBehaviour
{
Plugin plugin;

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

string dataKey = "string";
string dataValue = "string";
int dataTtl = 60;
plugin.CacheSet(dataKey, dataValue, dataTtl, (state, message, rawData, dictionary) => {
if (state.Equals(Configure.PN_API_STATE_SUCCESS))
{
Debug.Log("Success");
}
else
{
Debug.Log("Fail");
}
});
}
}

통신 결과

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