Method signature

SDK initialization. Must be called before calling any method (both when launching applications for the first time and when doing internal transitions across the frame).

FAPI.init(apiServer, apiConnection, onSuccess, onError)

Where:

  • apiServer - API server address. Can be acquired with FAPI.Util.getRequestParameters method;
  • apiConnection - API connection identifier. Can be acquired with FAPI.Util.getRequestParameters method;
  • onSuccess - callback function that will be invoked after a successful SDK initialization;
  • onError - callback function that will be invoked after a failed SDK initialization.

Example usage

/*
* API initialization
*/
var rParams = FAPI.Util.getRequestParameters();
FAPI.init(rParams["api_server"], rParams["apiconnection"],
          /*
          * callback for successful case
          */
          function() {
              
          },
          /*
          * callback for failed initialization
          */
          function(error) {
          }
);