Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3273

Re: How to send push notification to particular user

$
0
0

Hi Makoto,

 

I am using Kapsel for developing this app.

This is the code i have implementing in our Kapsel applicaton.

 

var uri = "http://<SMPserver:port>/restnotification/application/com.sap.<appName>";

 

   var odatamodel = new sap.ui.model.odata.ODataModel(uri);

   console.log(odatamodel);

   odatamodel.setHeaders({

    "Content-Type": "application/json",

    "Authorization": "Basic c21wUHVzaFVzZXI6c21wUHVzaFVzZXI="

   });

 

   var postEntry = {

    "alert": "New Vacation Approval Request",

    "data": "online"

   };

   var postContext = "/user/bhagwan";

   alert(postContext);

   odatamodel.create(postContext, postEntry, null, function() {

 

     alert("push success online...");

    },

    function(error) {

     alert("push fail online..." + error.message);

     console.log(error);

 

    }

   );

 

 

But when i am trying to run application it generates a error "Failed to execute send on xmlHTTPRequest"


Viewing all articles
Browse latest Browse all 3273

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>