Widget Init Params not working in ZC Mobile App

Widget Init Params not working in ZC Mobile App

Hi,

I am trying to fetch the Logged In User and show it in a field.
I have attached the screenshots for both the mobile app and Web View.

As you can see in the web view I am able to see the logged-in user email id but in the mobile app, its showing undefined.

Attaching the code as well.

Code -
  1. <!DOCTYPE html>
    <html>
    <script src="js/jScript.js"></script>
    <script src="js/widgetsdk.js"></script>

    <script>
      function loggedInUser(){
        ZOHO.CREATOR.init()
            .then(function(data) {
              //Code goes here
              var initparams = ZOHO.CREATOR.UTIL.getInitParams();
              document.getElementById("loggedInUser").value = initparams['loginUser'];
              alert(initparams);
            });
      }

      function checkuserExists(){
        userEmail = document.getElementById("loggedInUser").value;
        userEmpCode = document.getElementById("empCode").value;
        config = {
          appName:"test",
          reportName:"Logged_IN_User_Report",
          criteria : "(Email == \""+userEmail+"\" && Employee_Code = \""+userEmpCode+"\")",
        }
        ZOHO.CREATOR.API.getAllRecords(config).then(function(response){
          var recordArr = response.data;
          alert(recordArr);
        });
      }

    </script>

    <head>
      <meta charset="UTF-8">
    </head>

    <body onload=loggedInUser()>
      <div class="screen-1">
        <img src="./images/gardeniaLogo.png">
        <div class="email">
          <label for="email">Logged In User</label>
          <div class="sec-2">
            <input type="email" name="email" id="loggedInUser" placeholder="Username@gmail.com" disabled/>
          </div>
        </div>
        <div class="empCode">
          <label for="empCode">Employee Code</label>
          <div class="sec-2">
            <input type="text" name="empCode" id="empCode" placeholder="GC1001"/>
          </div>
        </div>
        <button class="login" onclick=checkuserExists()>Login </button>
      </div>
    </body>

    </html>