Plugin Directory

Changeset 1595901


Ignore:
Timestamp:
02/14/2017 06:20:29 PM (9 years ago)
Author:
Device Push
Message:

Resolve serveral bugs

Location:
device-push/trunk/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • device-push/trunk/js/settings.js

    r1595687 r1595901  
    6161    }
    6262}
     63
     64function saveImage(){
     65    document.getElementById('checkDataUser').click();
     66}
  • device-push/trunk/js/sw.js

    r1595468 r1595901  
    4040
    4141self.addEventListener('notificationclick', function(event) { 
     42    console.log(event);
    4243  event.notification.close();
    4344  var data;
     
    6263  );
    6364  }else if(event.action){
    64       //console.log(event.action);
     65      console.log(event.action);
    6566  }
    66  
    67     var _DP_configuration = {
    68       api: 'https://apiweb.devicepush.com:8081/mobile/action/register/',
    69       idUser: location.search.split('idUser=')[1].substr(0,24),
    70       idApplication : location.search.split('idApplication=')[1].substr(0,19)
    71     }
    72     console.log(_DP_configuration);
    73 
    74     var data = {
    75         method: 'POST',
    76         body: {
    77             "idNotification": "5894621338e49b731e6f78aa",
    78             "lat": "3",
    79             "lon": "1",
    80             "idDevice": "5895b96d35223d0735feff88",
    81             "action": "open"
    82         }
    83      };
    84                
    85     fetch(_DP_configuration.api + _DP_configuration.idApplication, data).then(function(response) { 
    86         if (response.status !== 200) { 
    87             console.log('Looks like there was a problem. Status Code: ' + response.status); 
    88             throw new Error(); 
    89         }
    90         return response.json().then(function(data) { 
    91             console.log('data');
    92             console.log(data);
    93             console.log('data');
    94         }); 
    95     });
    96  
    9767});
Note: See TracChangeset for help on using the changeset viewer.