appinfo.getContainerId - GiGAGenie-ServiceSDK/UserGuide GitHub Wiki

gigagenie.appinfo.getContainerId

API ์„ค๋ช…

  • ContainerId ์กฐํšŒ API
  • ํ•ด๋‹น ์•ฑ์— ๋Œ€ํ•œ G-Box ์˜ ContainerId ๋ฅผ ์กฐํšŒํ•จ

API ๊ตฌ์กฐ

  • function getContainerId(options,callback)
  • options
    • null
  • result_cd
    • 200: ์„ฑ๊ณต
    • 500: ์‹œ์Šคํ…œ Error
  • extra
    • containerid: (String) Container ์˜ ID ๊ฐ’
    • deviceid: (String) ๋‹จ๋ง์— Unique ํ•œ ID ๊ฐ’

์‚ฌ์šฉ ์˜ˆ์‹œ

// callback ๋ฐฉ์‹
var options = {};
gigagenie.appinfo.getContainerId(options, function (result_cd, result_msg, extra) {
    if (result_cd === 200) {
        console.log("The container id is " + extra.containerid);
        console.log("The device id is " + extra.deviceid);
    } else {
        console.log("getContainerId is fail.");
    }
});
// promise ๋ฐฉ์‹
var options = {};
gigagenie.appinfo.getContainerId(options).then(function (extra) {
    console.log("The container id is " + extra.containerid);
    console.log("The device id is " + extra.deviceid);
}).catch(function (result_cd, result_msg, extra) {
    console.log("getContainerId is fail.");
})