How to use web viewer get ip?

Use this,

<!DOCTYPE html>
<html>
<head>
  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>

  <script src="https://thunkable.github.io/webviewer-extension/thunkableWebviewerExtension.js" type="text/javascript"></script>


</head>
<body>
  
  <script>
  $.getJSON('https://api.ipify.org?format=jsonp&callback=?',   function(data) {
    console.log(JSON.stringify(data, null, 2));
    ThunkableWebviewerExtension.postMessage(JSON.stringify(data, null, 2));

  });
  </script>

</body>
</html>
1 Like