RodrigoD
Posts: 0
Joined: Tue Apr 29, 2014 3:57 pm

Push Notification to single device

I am tying to send a notification to a single device and its not working.
Here is the json I am using:
{"payload":{"message":"Notification sample","badge":0},"status":"sent","filter":{"deviceId":""}}

I got the deviceId from the devices table. When I remove the filter I get the notification.

RodrigoD
Posts: 0
Joined: Tue Apr 29, 2014 3:57 pm

Push Notification to single device

Well , it was a problem with my Json parser.
the json shoud be:
{"payload":{"message":"Notification sample","badge":0},"status":"sent","filter":{"deviceID":""}}

And here is my small .net code to send notifications
Fell free to add to tutorials.

string url = "https://api.appery.io/rest/push/msg";

Code: Select all

         using (WebClient client = new WebClient()) 
         { 
             client.Headers.Add("X-Appery-Push-API-Key", pushApkiKey); 
             client.Headers[HttpRequestHeader.ContentType]= "application/json"; 

             var responsebytes = client.UploadString(url, "POST",jsonString); 

         }
Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Push Notification to single device

Hello!

Thank you for update!

Return to “Issues”