appdata.setKeyData - GiGAGenie-ServiceSDK/UserGuide GitHub Wiki

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)์—์„œ ํ™•์ธ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค