How do I get Device Serial on PHONEGAP?

0

I need to make a get using phonegap. At the end of the URL you would like to add the device ID to see if it is already registered or not in the database. For sending I use the Jquery Ajax function. Below is the Code:

<script>
     window.onload =  function(){
                document.addEventListener('deviceready', iniciar);
                    function iniciar(){   
                        console.log('App Iniciado');
                        };

                    };

         $(document).ready(function(e){
            var a = device.serial;
              $.ajax({
                type: 'GET',
                url: "https://localhost/aulaphonegap/consulta.php?s="+a,  
                dataType:'json',
                timeout:5000,
                success: function(e){
                    if(e.Resp == 1){
                           console.log(e.Resp);

                         }else{
                            console.log("Segunda Opção");
                    }

                },
                error: function(e) {
                alert('Aviso!: ' + e.message);
                }
            })

          });       

    
asked by anonymous 01.08.2018 / 04:15

0 answers