Hello all,
I was able to get my app to register w/the push notification service and received a regID back that began with "04". I wanted to send a test notification and I created the following code which was copied from the Push API tutorial (https://developer.tizen.org/documentation/articles/push-api):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html><head> </head> <body > <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script language="JavaScript"> var registrationId='04<The rest of the regID>'; var secretId='<My Secret>'; var applicationId='<My App ID>'; var pushURL='https://apnortheast.push.samsungosp.com:8088/spp/pns/api/push'; jQuery.ajax({ type: 'POST', contentType: 'json', url: pushURL, headers: {"appID":applicationId, "appSecret":secretId}, data: JSON.stringify({ "regID":registrationId, "requestID":"000001", "message":"badgeOption=SET&badgeNumber=10&action=ALERT&alertMessage=Hi, You got push message", "appData":"Hello world" }), dataType: 'json', success: function(data, textStatus) { console.log('success');console.log(data); }, error: function(data, textStatus,errorThrown) { console.log('error');console.log(data);console.log(errorThrown);console.log(textStatus); } }); </script>
If I look in Net tab of Firebug when I point my browser to the html page that has the above code, the response to the jquery post is:
{"results":[{"regID":"","requestID":"","statusCode":3016,"statusMsg":"error of not supporting requested uri"}]}
What am I doing wrong?
Thanks!