WebAPI/SimplePush: Difference between revisions

Jump to navigation Jump to search
Line 67: Line 67:
   var reqEmail = navigator.pushNotifications.register();
   var reqEmail = navigator.pushNotifications.register();
   reqEmail.onsuccess = function(e) {
   reqEmail.onsuccess = function(e) {
     emailEndpoint = e.result.pushEndpoint;
     emailEndpoint = e.target.result.pushEndpoint;
     storeOnAppServer("email", emailEndpoint); <i>// This is the "Hand wavey" way that the app  
     storeOnAppServer("email", emailEndpoint); <i>// This is the "Hand wavey" way that the app  
                                                 // sends the endPoint back to the server</i>
                                                 // sends the endPoint back to the server</i>
Line 75: Line 75:
   var reqIm = navigator.pushNotifications.register();
   var reqIm = navigator.pushNotifications.register();
   reqIm.onsuccess = function(e) {
   reqIm.onsuccess = function(e) {
     imEndpoint = e.result.pushEndpoint;
     imEndpoint = e.target.result.pushEndpoint;
     storeOnAppServer("im", imEndpoint);
     storeOnAppServer("im", imEndpoint);
   }
   }
Confirmed users
93

edits

Navigation menu