Back to All

Call an objective-c method from custom javascript


Thanks to custom javascript added with Gonative website override, I would like to call a custom method "TestBridge" store in a file of my application. But I don't know in which file I have to define this method and I don't know how to call it.

Here is my javascript :

window.onload = function() {
  var specificPageUrl = "";

  if (window.location.href === specificPageUrl) {
    var buyButton = document.createElement("button");
    buyButton.innerHTML = "Je deviens IDEL++";
    buyButton.classList.add("primary-button-white", "w-button", "IDEL");

    var checkDivInterval = setInterval(function() {
      var IDELDiv = document.getElementById("IDEL-div");
      if (IDELDiv) {
        clearInterval(checkDivInterval); = "flex"; = "center"; = "center";
        buyButton.addEventListener("click", function() {
            functionName: "TestBridge",
            parameters: { }
          alert("Test JavaScript");
    }, 100);

    setTimeout(function() {
    }, 5000);

Could you please help me to write the "TestBridge" method that should display "Bridge Ok" in pop-up for example when the user click on the javascript button?

Thank you!