Languages

Menu
Sites
Language
Error 3016 when sending push notification

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!

Responses

1 Replies
Lakshmi Grandhi

Hi,

 

Did you added  below privileges in the project

<tizen:privilege name="http://tizen.org/privilege/push"/>
<access origin="https://{region}.push.samsungosp.com:8088" subdomains="true"/>

For more details go through the article https://developer.tizen.org/documentation/articles/push-api