init.fgCall - GiGAGenie-ServiceSDK/UserGuide GitHub Wiki

gigagenie.init.fgCall (Deprecated)

API 설명

  • Foreground 함수 호출 API
  • Background Action에서 Foreground에 등록된 gigagenie.init.onFgCall 함수를 호출
  • Foreground에 등록된 함수가 없으면 아무 동작도 하지 않음

API 구조

  • function fgCall(options,callback)
  • options
    • operation: (String, Mandatory) 전달할 사용자 정의 operation
    • parameters: (JSONObject, Optional) operation에 전달할 사용자 정의 parameter
  • result_cd
    • 200: 호출 성공
    • 404: Foreground에서 실행중인 action 없음
    • 500: 시스템 에러
  • extra
    • null

사용 예시

// callback 방식
var options = {};
options.operation = "Greeting";
options.parameters = {
    myname: "Kim"
};
gigagenie.init.fgCall(options, function (result_cd, result_msg, extra) {
    if (result_cd === 200) {
        console.log("FgCall transferred");
    } else {
        console.log("fgCall is fail.");
        console.log("result_cd: " + extra.result_cd);
    }
});