initWebSDK static method

void initWebSDK(
  1. String fcmPath
)

Implementation

static void initWebSDK(String fcmPath) {
  try{
    html.Element? head = html.document.querySelector('head');
    html.ScriptElement script = html.ScriptElement();
    script.defer = true;
    script.src = "https://sdk.resul.io/handlers/1f10f6c135ac43d8913c171173e1e2af.sdk";
    script.setAttribute('fcm_service_path', fcmPath.toString());
    head?.append(script);
    setupCustomEventListener(fcmPath);
  }catch(e){
    debugPrint("$e");
  }
}