How to submit HTML Form to Google Sheets from Cordova project

I am trying to develop an app for a family start up, I have a Apache Cordova project in Xcode with an HTML Form, that should send the form information to a script, using a POST method.

The form works on my website (, but not in the Xcode simulator, I will attach my app code below.

Thank you for any help! Liam

<!DOCTYPE html>
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.

         Customize this policy to fit your own app's needs. For more guidance, see:
         Some notes:
         * gap: is required only on iOS (when using UIWebView) and is needed for JS->native communication
         * is required only on Android and is needed for TalkBack to function properly
         * Disables use of inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
         * Enable inline JS: add 'unsafe-inline' to default-src
  <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data: content:;">
  <meta name="format-detection" content="telephone=no">
  <meta name="msapplication-tap-highlight" content="no">
  <meta name="viewport" content="initial-scale=1, width=device-width, viewport-fit=cover">
  <!doctype html>
  <html lang="en">

    <link rel="shortcut icon" href="waveimage.svg">
    <link href="" rel="stylesheet">
    <link href="" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="/Volumes/Untitled/SoarBay/platforms/ios/www/css/mobilestyle.css" title="style">
    <link rel="stylesheet" type="text/css" href="/css/style.css">
    <meta name="viewport" content="width=device-width, hight=device-hight, initial-scale=1">


    <!-- ORDER FORM-->

    <div class="form-container">
      <form name="submit-to-google-sheet">
        <input name="email" type="email" placeholder="Email" required="">
        <input name="firstName" type="text" placeholder="First Name">
        <input name="lastName" type="text" placeholder="Last Name">
        <input name="order" type="text" placeholder="Type your order here" required="">
        <input name="delivery" type="text" placeholder="Delivery address (if wanted)">
        <p style="font-size: 15px; color: #131F28;"><b>Please note, we only deliver in  Tsawwassen. And a $3 fee will be added.</b></p>

        <button type="submit">Submit</button>

      <div class="loading js-loading is-hidden">
        <div class="loading-spinner">
          <svg><circle cx="25" cy="25" r="20" fill="none" stroke-width="2" stroke-miterlimit="10"></circle></svg>

      <p class="js-success-message is-hidden">Success!</p>
      <p class="js-error-message is-hidden">Error!</p>

      const scriptURL = ''
      const form = document.forms['submit-to-google-sheet']
      const loading = document.querySelector('.js-loading')
      const successMessage = document.querySelector('.js-success-message')
      const errorMessage = document.querySelector('.js-error-message')

      form.addEventListener('submit', e => {
        fetch(scriptURL, {
            method: 'POST',
            body: new FormData(form)
          .then(response => showSuccessMessage(response))
          .catch(error => showErrorMessage(error))
        window.alert("Your order has been recieved, we will email your recipt. Thank you!");

      function showLoadingIndicator() {

      function showSuccessMessage(response) {
        console.log('Success!', response)
        setTimeout(() => {
        }, 500)

      function showErrorMessage(error) {
        console.error('Error!', error.message)
        setTimeout(() => {
        }, 500)