Skip to content

appdata.setKeyData

kt Genie edited this page May 24, 2024 · 4 revisions

gigagenie.appdata.setKeyData

API 설명

  • 데이터 설정 API
  • 특정 이름의 데이터네임스페이스 Key와 Data를 설정

API 구조

  • function setKeyData(options,callback)
  • options
    • namespace: (String, Mandatory) appdata Namespace
    • key: (String, Mandatory) Namespace에 설정하려는 데이터의 Key
    • data: (String, Mandatory) 로 해당 Namespace 의 Key 에 설정된 데이터
  • result_cd
    • 200: 성공
    • 403: 해당 Namespace 가 존재하지 않음
    • 406: 저장 Key 개수 초과
    • 413: 데이터 용량 초과
    • 500: 시스템 Error
  • extra
    • null

사용 예시

// callback 방식
var options = {};
options.namespace = 'userappprofile';
options.key = 'appusername';
options.data = 'helloappdata';
gigagenie.appdata.setKeyData(options, function (result_cd, result_msg, extra) {
    if (result_cd === 200) {
        console.log(options.key + ":" + options.data + " is set");
    } else {
        console.log("Error");
    }
});
// promise 방식
var options = {};
options.namespace = 'userappprofile';
options.key = 'appusername';
options.data = 'helloappdata';
gigagenie.appdata.setKeyData(options).then(function (extra) {
    console.log(options.key + ":" + options.data + " is set");
}).catch(function (result_cd, result_msg, extra) {
    console.log("Error");
})

활용 예제는 (GGiGA Genie 2048)에서 확인 가능합니다

UserGuide

Clone this wiki locally