init - GiGAGenie-ServiceSDK/UserGuide GitHub Wiki

gigagenie.init

API ์„ค๋ช…

  • API ์ดˆ๊ธฐํ™” API
  • GiGA Genie Service API ์ด์šฉ์„ ์œ„ํ•ด ์ดˆ๊ธฐํ™”๊ฐ€ ๋ฐ˜๋“œ์‹œ ์„ ํ–‰๋˜์–ด์•ผ ํ•จ
  • init์— ์‹คํŒจํ•  ๊ฒฝ์šฐ ์–ด๋– ํ•œ API๋„ ํ˜ธ์ถœ๋˜์ง€ ์•Š์œผ๋ฉฐ, ๋ชจ๋“  API์˜ result_cd ๋ฅผ 406์œผ๋กœ ๋ฆฌํ„ด

API ๊ตฌ์กฐ

  • function init(options,callback)
  • options
    • apikey: (String, Mandatory) APILink์—์„œ ๋ฐ›์€ apikey์ด๋ฉฐ, ๋“ฑ๋ก๋œ apikey๊ฐ€ ์•„๋‹Œ ๊ฒฝ์šฐ ์˜ค๋ฅ˜ ๋ฐœ์ƒ
    • keytype: (String, Mandatory) API Key ์œ ํ˜•์œผ๋กœ ๋‹ค์Œ ๋‘ ๊ฐ€์ง€๋ฅผ ์ง€์›
      • GBOXDEVM: G-Box ๊ฐœ๋ฐœ ํ‚ค(๊ฐœ๋ฐœ์ž๋ชจ๋“œ๊ฐ€ ์„ค์ •๋˜์–ด ์žˆ์–ด์•ผ ํ•จ)
      • GBOXCOMM: G-Box ์ƒ์šฉ ํ‚ค
    • muteEndingRingtone: (Boolean, Optional, OnlyLTE) LTE ๋‹จ๋ง์—์„œ ์„œ๋น„์Šค ์ข…๋ฃŒ์‹œ ์ข…๋ฃŒ์Œ ํ”Œ๋ ˆ์ด ์—ฌ๋ถ€ ์„ ํƒ
      • true: ์ข…๋ฃŒ์Œ ๋ฏธ์žฌ์ƒ
      • false: ์ข…๋ฃŒ์Œ ์žฌ์ƒ(default)
  • result_cd
    • 200: ์ •์ƒ ์ดˆ๊ธฐํ™”
  • extra
    • sdkversion: (String) ์ด์šฉ ๊ฐ€์ด๋“œ ๋ฒ„์ „ ์ „๋‹ฌ
    • appversion: (String) ContainerApp ๋ฒ„์ „ ์ „๋‹ฌ
    • devicetype: (String) ๋””๋ฐ”์ด์Šค ์œ ํ˜•์ด ์ „๋‹ฌ๋จ(sdkversion 1.4์—์„œ ์ง€์›)
      • GGENIE: ๊ธฐ๊ฐ€์ง€๋‹ˆ1
      • GGENIE2: ๊ธฐ๊ฐ€์ง€๋‹ˆ2
      • GGENIE3: ๊ธฐ๊ฐ€์ง€๋‹ˆ3
      • GGENIESKYLIFE: ๊ธฐ๊ฐ€์ง€๋‹ˆ ์Šค์นด์ด๋ผ์ดํ”„
      • GGENIETABLETV: ๊ธฐ๊ฐ€์ง€๋‹ˆ TableTV
      • GGENIETABLETVSB: ๊ธฐ๊ฐ€์ง€๋‹ˆ TableTVSB
      • GGENIETABLETV2: ๊ธฐ๊ฐ€์ง€๋‹ˆ TableTV2
      • ATV: ๊ธฐ๊ฐ€์ง€๋‹ˆA
      • GGENIE3ATV: ๊ธฐ๊ฐ€์ง€๋‹ˆ3 AndroidTV
      • GGENIE2ATV: ๊ธฐ๊ฐ€์ง€๋‹ˆ2 AndroidTV
      • GGENIELTE: ๊ธฐ๊ฐ€์ง€๋‹ˆ LTE1
      • GGENIELTE2: ๊ธฐ๊ฐ€์ง€๋‹ˆ LTE2
      • GGENIESOUNDBAR: ๊ธฐ๊ฐ€์ง€๋‹ˆ TV Soundbar
    • displayflag: (String) ํ™”๋ฉด ์ง€์› ์—ฌ๋ถ€ ์ „๋‹ฌ
      • Y: WindowType์ด FW, OW, FN, ON ์ผ ๊ฒฝ์šฐ
      • N: WindowType์ด BS, BN์ธ ๊ฒฝ์šฐ

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

// callback ๋ฐฉ์‹
var options = {};
options.apikey = "asdnblkb1231lkj3nrlkjlkjsfsdf";
options.keytype = "GBOXDEVM"; // ๊ฐœ๋ฐœ์ž ๋ชจ๋“œ ์„ค์ • ํ›„ ์‚ฌ์šฉ  
//options.keytype="GBOXCOMM"; // APILink ์Šน์ธ ํ›„ ์‚ฌ์šฉ
gigagenie.init(options, function (result_cd, result_msg, extra) {
    if (result_cd === 200) {
        console.log("initialize success");
    };
});
// promise ๋ฐฉ์‹
var options = {};
options.apikey = "asdnblkb1231lkj3nrlkjlkjsfsdf";
options.keytype = "GBOXDEVM"; // ๊ฐœ๋ฐœ์ž ๋ชจ๋“œ ์„ค์ • ํ›„ ์‚ฌ์šฉ   
//options.keytype="GBOXCOMM"; // APILink ์Šน์ธ ํ›„ ์‚ฌ์šฉ 
gigagenie.init(options).then(function (extra) {
    console.log("initialize success");
}).catch(function (result_cd, result_msg, extra) {
    console.log("initialize fail");
});

ํ™œ์šฉ ์˜ˆ์ œ๋Š” GiGA Genie ๊ตฌ๊ตฌ๋‹จ์—์„œ ํ™•์ธ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค