Tizen Application still “UNREGISTERED” after request approved for Push Service









up vote
0
down vote

favorite












My Tizen push messaging service request has been approved. However when I go to register to the push service, it responds by outputting to the console that the state is 'UNREGISTERED'. The app itself will run as a wearable web-app and is being tested currently on Tizen's wearable emulator. It works and updates the SQL database appropriately using AJAX, however, the push notifications and the push API in general from Tizen have been problematic to implement. I tried to post to Tizen forums, however, they are mostly in Korean and I don't see where I can post to it. I need to know what else is required to successfully register and push notifications to Tizen's push server via the web-app running on the wearable emulator. Thanks for your time!



##config.xml
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/TAUBasicdemo" version="1.0.0" viewmodes="maximized">
<tizen:application id="4MgeHxcwvw.TAUBasicdemo" package="4MgeHxcwvw" required_version="3.0"/>
<tizen:privilege name="http://tizen.org/privilege/push"/>
<tizen:privilege name="http://tizen.org/privilege/notification"/>
<tizen:privilege name="http://www.tizen.org/privileg/internet"/>
<access origin="*" subdomains="true"/>
<content src="index.html"/>
<feature name="http://tizen.org/feature/network.push"/>
<feature name="http://tizen.org/feature/screen.size.normal"/>
<feature name="http://tizen.org/feature/web.service"/>
<feature name="http://tizen.org/feature/watch_app"/>
<feature name="http://tizen.org/feature/web.service"/>
<feature name="http://tizen.org/feature/network.internet"/>
<icon src="icon.png"/>
<name>TAUBasicdemo</name>

<tizen:profile name="wearable"/>
<tizen:setting background-support="disable" encryption="disable" hwkey-event="enable"/>
</widget>

##notification.js
//------------------ NOTIFICATION REGISTRY -----------------------
/*eslint-disable*/
/* Define the error callback */
function errorCallback(response) console.log('The following error occurred: ' + response.name);

/* Define the registration success callback */
function registerSuccessCallback(id) console.log('Registration succeeded with id: ' + id);

/* Define the state change callback */
function stateChangeCallback(state)

if (state === 'UNREGISTERED')
/* Request application registration */
console.log('The state is changed to: ' + state);
tizen.push.register(registerSuccessCallback, errorCallback);
else if (state === 'REGISTERED')
/* Gets unread push notifications */
console.log('The state is changed to: ' + state);
tizen.push.getUnreadNotifications();



//------------------- NOTIFICATION RECEIVING -----------------------

/* Define the notification callback */
function notificationCallback(notification)
console.log('A notification arrives.');

tizen.push.connect(stateChangeCallback, notificationCallback, errorCallback);

var registrationId = tizen.push.getRegistrationId();
if (registrationId !== null)
console.log('The registration id: ' + registrationId);
else console.log('UNREGISTERED STILL');

//-----------------HANDLING LAUNCH FROM PUSH SERVICE -----------------------
var requestedAppControl = tizen.application.getCurrentApplication().getRequestedAppControl().appControl;

var pushMessage;

for (var i = 0; i < requestedAppControl.data.length; ++i)
if (requestedAppControl.data[i].key === 'http://tizen.org/appcontrol/data/push/launch_type')
/* Launch type is 'registration_change' or 'notification' */
var appData = requestedAppControl.data[i].value[0];
console.log('launch_type: ' + appData);
if (appData === 'registration_change')
/* Launched due to change in the registration state */
else if (appData === 'notification')
/* Launched due to a notification */
try
/* Retrieve the latest message */
var pushMessage = tizen.push.getPushMessage();
/* Handle the retrieved message */
catch (error)
console.log(error.name + ': ' + error.message);





//------------MSG RETRIEVE WHEN LAUNCHED FROM PUSH SERVICE ---------

if (pushMessage)
console.log('notification received on ' + pushMessage.date + ' from: ' + pushMessage.sender);
console.log('Details:');
console.log(' - data: ' + pushMessage.appData);
console.log(' - alert message: ' + pushMessage.alertMessage);
console.log(' - message: ' + pushMessage.message);
console.log(' - session: ' + pushMessage.sessionInfo);
console.log(' - request ID: ' + pushMessage.requestId);
console.log(' - type: ' + pushMessage.type);


##index.html
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="./lib/tau/mobile/theme/default/tau.css"/>
<meta name="viewport" content="width=device-width,user-scalable=no">
<link rel="stylesheet" href="lib/tau/wearable/theme/default/tau.min.css">
<link rel="stylesheet" media="all and (-tizen-geometric-shape: circle)" href="lib/tau/wearable/theme/default/tau.circle.min.css">
<!-- load theme file for your application -->
<link rel="stylesheet" href="css/style.css">
<script src="lib/tau/wearable/js/tau.min.js"></script>
<script src="js/app.js"></script>

<script type="text/javascript" src="./lib/tau/mobile/js/tau.js"></script>
<script src="js/lowBatteryCheck.js"></script>
<script src="js/circle-helper.js"></script>
<script src="js/notification.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

</head>

<body>
<!-- <div class="ui-page ui-page-active" id="main"> -->
<!-- <header> -->
<!-- <h2 class="ui-title">TAU Basic</h2> -->
<!-- </header> -->
<!-- </div> -->

<button onclick="myFunction()">Click Here!</button>


<p align="center">Start Age Confirmation</p>
<p id="demo"></p>

<script>
function myFunction()
var txt;
var content = "";
var ofAge_21 = confirm("Is the customer older than 21?");
var file = "http://10.146.3.164/process.php";

if (ofAge_21 == true)
txt = "Customer OVER 21.";
content = "INSERT INTO age_confirmation_records (Age_Range) VALUES (21)";

else
var ofAge_18 = confirm("Are they older than 18?");
if (ofAge_18 == true)
txt = "Customer BETWEEN 18-21.";
content = "INSERT INTO age_confirmation_records (Age_Range) VALUES (18)";
else
txt = "Customer UNDER 18.";
content = "INSERT INTO age_confirmation_records (Age_Range) VALUES (0)";


alert("CONFIRMED: " + txt);
//POST the SQL command you want to execute to the process.php file
$(document).ready(function()
$.post(file, sql_insert: content ,
function(data, status)
alert("Data: " + data + "nStatus: " + status); , 'html');
);


</script>

</body>
</html>
##output:
The web console logging API (console.log, console.info, console.warn,
console.error) has been disabled.
To activate it, you should launch project with Debug mode.
file:///js/notification.js (34) :UNREGISTERED STILL
file:///js/notification.js (14) :The state is changed to: UNREGISTERED
file:///js/notification.js (4) :The following error occurred: TimeoutError









share|improve this question

























    up vote
    0
    down vote

    favorite












    My Tizen push messaging service request has been approved. However when I go to register to the push service, it responds by outputting to the console that the state is 'UNREGISTERED'. The app itself will run as a wearable web-app and is being tested currently on Tizen's wearable emulator. It works and updates the SQL database appropriately using AJAX, however, the push notifications and the push API in general from Tizen have been problematic to implement. I tried to post to Tizen forums, however, they are mostly in Korean and I don't see where I can post to it. I need to know what else is required to successfully register and push notifications to Tizen's push server via the web-app running on the wearable emulator. Thanks for your time!



    ##config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/TAUBasicdemo" version="1.0.0" viewmodes="maximized">
    <tizen:application id="4MgeHxcwvw.TAUBasicdemo" package="4MgeHxcwvw" required_version="3.0"/>
    <tizen:privilege name="http://tizen.org/privilege/push"/>
    <tizen:privilege name="http://tizen.org/privilege/notification"/>
    <tizen:privilege name="http://www.tizen.org/privileg/internet"/>
    <access origin="*" subdomains="true"/>
    <content src="index.html"/>
    <feature name="http://tizen.org/feature/network.push"/>
    <feature name="http://tizen.org/feature/screen.size.normal"/>
    <feature name="http://tizen.org/feature/web.service"/>
    <feature name="http://tizen.org/feature/watch_app"/>
    <feature name="http://tizen.org/feature/web.service"/>
    <feature name="http://tizen.org/feature/network.internet"/>
    <icon src="icon.png"/>
    <name>TAUBasicdemo</name>

    <tizen:profile name="wearable"/>
    <tizen:setting background-support="disable" encryption="disable" hwkey-event="enable"/>
    </widget>

    ##notification.js
    //------------------ NOTIFICATION REGISTRY -----------------------
    /*eslint-disable*/
    /* Define the error callback */
    function errorCallback(response) console.log('The following error occurred: ' + response.name);

    /* Define the registration success callback */
    function registerSuccessCallback(id) console.log('Registration succeeded with id: ' + id);

    /* Define the state change callback */
    function stateChangeCallback(state)

    if (state === 'UNREGISTERED')
    /* Request application registration */
    console.log('The state is changed to: ' + state);
    tizen.push.register(registerSuccessCallback, errorCallback);
    else if (state === 'REGISTERED')
    /* Gets unread push notifications */
    console.log('The state is changed to: ' + state);
    tizen.push.getUnreadNotifications();



    //------------------- NOTIFICATION RECEIVING -----------------------

    /* Define the notification callback */
    function notificationCallback(notification)
    console.log('A notification arrives.');

    tizen.push.connect(stateChangeCallback, notificationCallback, errorCallback);

    var registrationId = tizen.push.getRegistrationId();
    if (registrationId !== null)
    console.log('The registration id: ' + registrationId);
    else console.log('UNREGISTERED STILL');

    //-----------------HANDLING LAUNCH FROM PUSH SERVICE -----------------------
    var requestedAppControl = tizen.application.getCurrentApplication().getRequestedAppControl().appControl;

    var pushMessage;

    for (var i = 0; i < requestedAppControl.data.length; ++i)
    if (requestedAppControl.data[i].key === 'http://tizen.org/appcontrol/data/push/launch_type')
    /* Launch type is 'registration_change' or 'notification' */
    var appData = requestedAppControl.data[i].value[0];
    console.log('launch_type: ' + appData);
    if (appData === 'registration_change')
    /* Launched due to change in the registration state */
    else if (appData === 'notification')
    /* Launched due to a notification */
    try
    /* Retrieve the latest message */
    var pushMessage = tizen.push.getPushMessage();
    /* Handle the retrieved message */
    catch (error)
    console.log(error.name + ': ' + error.message);





    //------------MSG RETRIEVE WHEN LAUNCHED FROM PUSH SERVICE ---------

    if (pushMessage)
    console.log('notification received on ' + pushMessage.date + ' from: ' + pushMessage.sender);
    console.log('Details:');
    console.log(' - data: ' + pushMessage.appData);
    console.log(' - alert message: ' + pushMessage.alertMessage);
    console.log(' - message: ' + pushMessage.message);
    console.log(' - session: ' + pushMessage.sessionInfo);
    console.log(' - request ID: ' + pushMessage.requestId);
    console.log(' - type: ' + pushMessage.type);


    ##index.html
    <!DOCTYPE html>
    <html>
    <head>
    <link rel="stylesheet" href="./lib/tau/mobile/theme/default/tau.css"/>
    <meta name="viewport" content="width=device-width,user-scalable=no">
    <link rel="stylesheet" href="lib/tau/wearable/theme/default/tau.min.css">
    <link rel="stylesheet" media="all and (-tizen-geometric-shape: circle)" href="lib/tau/wearable/theme/default/tau.circle.min.css">
    <!-- load theme file for your application -->
    <link rel="stylesheet" href="css/style.css">
    <script src="lib/tau/wearable/js/tau.min.js"></script>
    <script src="js/app.js"></script>

    <script type="text/javascript" src="./lib/tau/mobile/js/tau.js"></script>
    <script src="js/lowBatteryCheck.js"></script>
    <script src="js/circle-helper.js"></script>
    <script src="js/notification.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

    </head>

    <body>
    <!-- <div class="ui-page ui-page-active" id="main"> -->
    <!-- <header> -->
    <!-- <h2 class="ui-title">TAU Basic</h2> -->
    <!-- </header> -->
    <!-- </div> -->

    <button onclick="myFunction()">Click Here!</button>


    <p align="center">Start Age Confirmation</p>
    <p id="demo"></p>

    <script>
    function myFunction()
    var txt;
    var content = "";
    var ofAge_21 = confirm("Is the customer older than 21?");
    var file = "http://10.146.3.164/process.php";

    if (ofAge_21 == true)
    txt = "Customer OVER 21.";
    content = "INSERT INTO age_confirmation_records (Age_Range) VALUES (21)";

    else
    var ofAge_18 = confirm("Are they older than 18?");
    if (ofAge_18 == true)
    txt = "Customer BETWEEN 18-21.";
    content = "INSERT INTO age_confirmation_records (Age_Range) VALUES (18)";
    else
    txt = "Customer UNDER 18.";
    content = "INSERT INTO age_confirmation_records (Age_Range) VALUES (0)";


    alert("CONFIRMED: " + txt);
    //POST the SQL command you want to execute to the process.php file
    $(document).ready(function()
    $.post(file, sql_insert: content ,
    function(data, status)
    alert("Data: " + data + "nStatus: " + status); , 'html');
    );


    </script>

    </body>
    </html>
    ##output:
    The web console logging API (console.log, console.info, console.warn,
    console.error) has been disabled.
    To activate it, you should launch project with Debug mode.
    file:///js/notification.js (34) :UNREGISTERED STILL
    file:///js/notification.js (14) :The state is changed to: UNREGISTERED
    file:///js/notification.js (4) :The following error occurred: TimeoutError









    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      My Tizen push messaging service request has been approved. However when I go to register to the push service, it responds by outputting to the console that the state is 'UNREGISTERED'. The app itself will run as a wearable web-app and is being tested currently on Tizen's wearable emulator. It works and updates the SQL database appropriately using AJAX, however, the push notifications and the push API in general from Tizen have been problematic to implement. I tried to post to Tizen forums, however, they are mostly in Korean and I don't see where I can post to it. I need to know what else is required to successfully register and push notifications to Tizen's push server via the web-app running on the wearable emulator. Thanks for your time!



      ##config.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/TAUBasicdemo" version="1.0.0" viewmodes="maximized">
      <tizen:application id="4MgeHxcwvw.TAUBasicdemo" package="4MgeHxcwvw" required_version="3.0"/>
      <tizen:privilege name="http://tizen.org/privilege/push"/>
      <tizen:privilege name="http://tizen.org/privilege/notification"/>
      <tizen:privilege name="http://www.tizen.org/privileg/internet"/>
      <access origin="*" subdomains="true"/>
      <content src="index.html"/>
      <feature name="http://tizen.org/feature/network.push"/>
      <feature name="http://tizen.org/feature/screen.size.normal"/>
      <feature name="http://tizen.org/feature/web.service"/>
      <feature name="http://tizen.org/feature/watch_app"/>
      <feature name="http://tizen.org/feature/web.service"/>
      <feature name="http://tizen.org/feature/network.internet"/>
      <icon src="icon.png"/>
      <name>TAUBasicdemo</name>

      <tizen:profile name="wearable"/>
      <tizen:setting background-support="disable" encryption="disable" hwkey-event="enable"/>
      </widget>

      ##notification.js
      //------------------ NOTIFICATION REGISTRY -----------------------
      /*eslint-disable*/
      /* Define the error callback */
      function errorCallback(response) console.log('The following error occurred: ' + response.name);

      /* Define the registration success callback */
      function registerSuccessCallback(id) console.log('Registration succeeded with id: ' + id);

      /* Define the state change callback */
      function stateChangeCallback(state)

      if (state === 'UNREGISTERED')
      /* Request application registration */
      console.log('The state is changed to: ' + state);
      tizen.push.register(registerSuccessCallback, errorCallback);
      else if (state === 'REGISTERED')
      /* Gets unread push notifications */
      console.log('The state is changed to: ' + state);
      tizen.push.getUnreadNotifications();



      //------------------- NOTIFICATION RECEIVING -----------------------

      /* Define the notification callback */
      function notificationCallback(notification)
      console.log('A notification arrives.');

      tizen.push.connect(stateChangeCallback, notificationCallback, errorCallback);

      var registrationId = tizen.push.getRegistrationId();
      if (registrationId !== null)
      console.log('The registration id: ' + registrationId);
      else console.log('UNREGISTERED STILL');

      //-----------------HANDLING LAUNCH FROM PUSH SERVICE -----------------------
      var requestedAppControl = tizen.application.getCurrentApplication().getRequestedAppControl().appControl;

      var pushMessage;

      for (var i = 0; i < requestedAppControl.data.length; ++i)
      if (requestedAppControl.data[i].key === 'http://tizen.org/appcontrol/data/push/launch_type')
      /* Launch type is 'registration_change' or 'notification' */
      var appData = requestedAppControl.data[i].value[0];
      console.log('launch_type: ' + appData);
      if (appData === 'registration_change')
      /* Launched due to change in the registration state */
      else if (appData === 'notification')
      /* Launched due to a notification */
      try
      /* Retrieve the latest message */
      var pushMessage = tizen.push.getPushMessage();
      /* Handle the retrieved message */
      catch (error)
      console.log(error.name + ': ' + error.message);





      //------------MSG RETRIEVE WHEN LAUNCHED FROM PUSH SERVICE ---------

      if (pushMessage)
      console.log('notification received on ' + pushMessage.date + ' from: ' + pushMessage.sender);
      console.log('Details:');
      console.log(' - data: ' + pushMessage.appData);
      console.log(' - alert message: ' + pushMessage.alertMessage);
      console.log(' - message: ' + pushMessage.message);
      console.log(' - session: ' + pushMessage.sessionInfo);
      console.log(' - request ID: ' + pushMessage.requestId);
      console.log(' - type: ' + pushMessage.type);


      ##index.html
      <!DOCTYPE html>
      <html>
      <head>
      <link rel="stylesheet" href="./lib/tau/mobile/theme/default/tau.css"/>
      <meta name="viewport" content="width=device-width,user-scalable=no">
      <link rel="stylesheet" href="lib/tau/wearable/theme/default/tau.min.css">
      <link rel="stylesheet" media="all and (-tizen-geometric-shape: circle)" href="lib/tau/wearable/theme/default/tau.circle.min.css">
      <!-- load theme file for your application -->
      <link rel="stylesheet" href="css/style.css">
      <script src="lib/tau/wearable/js/tau.min.js"></script>
      <script src="js/app.js"></script>

      <script type="text/javascript" src="./lib/tau/mobile/js/tau.js"></script>
      <script src="js/lowBatteryCheck.js"></script>
      <script src="js/circle-helper.js"></script>
      <script src="js/notification.js"></script>
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

      </head>

      <body>
      <!-- <div class="ui-page ui-page-active" id="main"> -->
      <!-- <header> -->
      <!-- <h2 class="ui-title">TAU Basic</h2> -->
      <!-- </header> -->
      <!-- </div> -->

      <button onclick="myFunction()">Click Here!</button>


      <p align="center">Start Age Confirmation</p>
      <p id="demo"></p>

      <script>
      function myFunction()
      var txt;
      var content = "";
      var ofAge_21 = confirm("Is the customer older than 21?");
      var file = "http://10.146.3.164/process.php";

      if (ofAge_21 == true)
      txt = "Customer OVER 21.";
      content = "INSERT INTO age_confirmation_records (Age_Range) VALUES (21)";

      else
      var ofAge_18 = confirm("Are they older than 18?");
      if (ofAge_18 == true)
      txt = "Customer BETWEEN 18-21.";
      content = "INSERT INTO age_confirmation_records (Age_Range) VALUES (18)";
      else
      txt = "Customer UNDER 18.";
      content = "INSERT INTO age_confirmation_records (Age_Range) VALUES (0)";


      alert("CONFIRMED: " + txt);
      //POST the SQL command you want to execute to the process.php file
      $(document).ready(function()
      $.post(file, sql_insert: content ,
      function(data, status)
      alert("Data: " + data + "nStatus: " + status); , 'html');
      );


      </script>

      </body>
      </html>
      ##output:
      The web console logging API (console.log, console.info, console.warn,
      console.error) has been disabled.
      To activate it, you should launch project with Debug mode.
      file:///js/notification.js (34) :UNREGISTERED STILL
      file:///js/notification.js (14) :The state is changed to: UNREGISTERED
      file:///js/notification.js (4) :The following error occurred: TimeoutError









      share|improve this question













      My Tizen push messaging service request has been approved. However when I go to register to the push service, it responds by outputting to the console that the state is 'UNREGISTERED'. The app itself will run as a wearable web-app and is being tested currently on Tizen's wearable emulator. It works and updates the SQL database appropriately using AJAX, however, the push notifications and the push API in general from Tizen have been problematic to implement. I tried to post to Tizen forums, however, they are mostly in Korean and I don't see where I can post to it. I need to know what else is required to successfully register and push notifications to Tizen's push server via the web-app running on the wearable emulator. Thanks for your time!



      ##config.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/TAUBasicdemo" version="1.0.0" viewmodes="maximized">
      <tizen:application id="4MgeHxcwvw.TAUBasicdemo" package="4MgeHxcwvw" required_version="3.0"/>
      <tizen:privilege name="http://tizen.org/privilege/push"/>
      <tizen:privilege name="http://tizen.org/privilege/notification"/>
      <tizen:privilege name="http://www.tizen.org/privileg/internet"/>
      <access origin="*" subdomains="true"/>
      <content src="index.html"/>
      <feature name="http://tizen.org/feature/network.push"/>
      <feature name="http://tizen.org/feature/screen.size.normal"/>
      <feature name="http://tizen.org/feature/web.service"/>
      <feature name="http://tizen.org/feature/watch_app"/>
      <feature name="http://tizen.org/feature/web.service"/>
      <feature name="http://tizen.org/feature/network.internet"/>
      <icon src="icon.png"/>
      <name>TAUBasicdemo</name>

      <tizen:profile name="wearable"/>
      <tizen:setting background-support="disable" encryption="disable" hwkey-event="enable"/>
      </widget>

      ##notification.js
      //------------------ NOTIFICATION REGISTRY -----------------------
      /*eslint-disable*/
      /* Define the error callback */
      function errorCallback(response) console.log('The following error occurred: ' + response.name);

      /* Define the registration success callback */
      function registerSuccessCallback(id) console.log('Registration succeeded with id: ' + id);

      /* Define the state change callback */
      function stateChangeCallback(state)

      if (state === 'UNREGISTERED')
      /* Request application registration */
      console.log('The state is changed to: ' + state);
      tizen.push.register(registerSuccessCallback, errorCallback);
      else if (state === 'REGISTERED')
      /* Gets unread push notifications */
      console.log('The state is changed to: ' + state);
      tizen.push.getUnreadNotifications();



      //------------------- NOTIFICATION RECEIVING -----------------------

      /* Define the notification callback */
      function notificationCallback(notification)
      console.log('A notification arrives.');

      tizen.push.connect(stateChangeCallback, notificationCallback, errorCallback);

      var registrationId = tizen.push.getRegistrationId();
      if (registrationId !== null)
      console.log('The registration id: ' + registrationId);
      else console.log('UNREGISTERED STILL');

      //-----------------HANDLING LAUNCH FROM PUSH SERVICE -----------------------
      var requestedAppControl = tizen.application.getCurrentApplication().getRequestedAppControl().appControl;

      var pushMessage;

      for (var i = 0; i < requestedAppControl.data.length; ++i)
      if (requestedAppControl.data[i].key === 'http://tizen.org/appcontrol/data/push/launch_type')
      /* Launch type is 'registration_change' or 'notification' */
      var appData = requestedAppControl.data[i].value[0];
      console.log('launch_type: ' + appData);
      if (appData === 'registration_change')
      /* Launched due to change in the registration state */
      else if (appData === 'notification')
      /* Launched due to a notification */
      try
      /* Retrieve the latest message */
      var pushMessage = tizen.push.getPushMessage();
      /* Handle the retrieved message */
      catch (error)
      console.log(error.name + ': ' + error.message);





      //------------MSG RETRIEVE WHEN LAUNCHED FROM PUSH SERVICE ---------

      if (pushMessage)
      console.log('notification received on ' + pushMessage.date + ' from: ' + pushMessage.sender);
      console.log('Details:');
      console.log(' - data: ' + pushMessage.appData);
      console.log(' - alert message: ' + pushMessage.alertMessage);
      console.log(' - message: ' + pushMessage.message);
      console.log(' - session: ' + pushMessage.sessionInfo);
      console.log(' - request ID: ' + pushMessage.requestId);
      console.log(' - type: ' + pushMessage.type);


      ##index.html
      <!DOCTYPE html>
      <html>
      <head>
      <link rel="stylesheet" href="./lib/tau/mobile/theme/default/tau.css"/>
      <meta name="viewport" content="width=device-width,user-scalable=no">
      <link rel="stylesheet" href="lib/tau/wearable/theme/default/tau.min.css">
      <link rel="stylesheet" media="all and (-tizen-geometric-shape: circle)" href="lib/tau/wearable/theme/default/tau.circle.min.css">
      <!-- load theme file for your application -->
      <link rel="stylesheet" href="css/style.css">
      <script src="lib/tau/wearable/js/tau.min.js"></script>
      <script src="js/app.js"></script>

      <script type="text/javascript" src="./lib/tau/mobile/js/tau.js"></script>
      <script src="js/lowBatteryCheck.js"></script>
      <script src="js/circle-helper.js"></script>
      <script src="js/notification.js"></script>
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

      </head>

      <body>
      <!-- <div class="ui-page ui-page-active" id="main"> -->
      <!-- <header> -->
      <!-- <h2 class="ui-title">TAU Basic</h2> -->
      <!-- </header> -->
      <!-- </div> -->

      <button onclick="myFunction()">Click Here!</button>


      <p align="center">Start Age Confirmation</p>
      <p id="demo"></p>

      <script>
      function myFunction()
      var txt;
      var content = "";
      var ofAge_21 = confirm("Is the customer older than 21?");
      var file = "http://10.146.3.164/process.php";

      if (ofAge_21 == true)
      txt = "Customer OVER 21.";
      content = "INSERT INTO age_confirmation_records (Age_Range) VALUES (21)";

      else
      var ofAge_18 = confirm("Are they older than 18?");
      if (ofAge_18 == true)
      txt = "Customer BETWEEN 18-21.";
      content = "INSERT INTO age_confirmation_records (Age_Range) VALUES (18)";
      else
      txt = "Customer UNDER 18.";
      content = "INSERT INTO age_confirmation_records (Age_Range) VALUES (0)";


      alert("CONFIRMED: " + txt);
      //POST the SQL command you want to execute to the process.php file
      $(document).ready(function()
      $.post(file, sql_insert: content ,
      function(data, status)
      alert("Data: " + data + "nStatus: " + status); , 'html');
      );


      </script>

      </body>
      </html>
      ##output:
      The web console logging API (console.log, console.info, console.warn,
      console.error) has been disabled.
      To activate it, you should launch project with Debug mode.
      file:///js/notification.js (34) :UNREGISTERED STILL
      file:///js/notification.js (14) :The state is changed to: UNREGISTERED
      file:///js/notification.js (4) :The following error occurred: TimeoutError






      tizen tizen-web-app tizen-wearable-sdk tizen-emulator tizen-studio






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 9 at 18:11









      Eric Baker

      14




      14






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          I believe this is a problem with privilege
          I addition to feature you also need to declare the privilege in the manifest.



          <privilege name="http://tizen.org/privilege/push"</privilege>


          Hopefully this helps.






          share|improve this answer




















          • that is the first privilege I have in the config.xml posted, and I had the feature as well.
            – Eric Baker
            Nov 12 at 13:06










          • Please check if pushd daemon is active in the emulator.
            – Sanjeev BA
            2 days ago










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53231235%2ftizen-application-still-unregistered-after-request-approved-for-push-service%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          I believe this is a problem with privilege
          I addition to feature you also need to declare the privilege in the manifest.



          <privilege name="http://tizen.org/privilege/push"</privilege>


          Hopefully this helps.






          share|improve this answer




















          • that is the first privilege I have in the config.xml posted, and I had the feature as well.
            – Eric Baker
            Nov 12 at 13:06










          • Please check if pushd daemon is active in the emulator.
            – Sanjeev BA
            2 days ago














          up vote
          0
          down vote













          I believe this is a problem with privilege
          I addition to feature you also need to declare the privilege in the manifest.



          <privilege name="http://tizen.org/privilege/push"</privilege>


          Hopefully this helps.






          share|improve this answer




















          • that is the first privilege I have in the config.xml posted, and I had the feature as well.
            – Eric Baker
            Nov 12 at 13:06










          • Please check if pushd daemon is active in the emulator.
            – Sanjeev BA
            2 days ago












          up vote
          0
          down vote










          up vote
          0
          down vote









          I believe this is a problem with privilege
          I addition to feature you also need to declare the privilege in the manifest.



          <privilege name="http://tizen.org/privilege/push"</privilege>


          Hopefully this helps.






          share|improve this answer












          I believe this is a problem with privilege
          I addition to feature you also need to declare the privilege in the manifest.



          <privilege name="http://tizen.org/privilege/push"</privilege>


          Hopefully this helps.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 11 at 12:25









          Sanjeev BA

          1626




          1626











          • that is the first privilege I have in the config.xml posted, and I had the feature as well.
            – Eric Baker
            Nov 12 at 13:06










          • Please check if pushd daemon is active in the emulator.
            – Sanjeev BA
            2 days ago
















          • that is the first privilege I have in the config.xml posted, and I had the feature as well.
            – Eric Baker
            Nov 12 at 13:06










          • Please check if pushd daemon is active in the emulator.
            – Sanjeev BA
            2 days ago















          that is the first privilege I have in the config.xml posted, and I had the feature as well.
          – Eric Baker
          Nov 12 at 13:06




          that is the first privilege I have in the config.xml posted, and I had the feature as well.
          – Eric Baker
          Nov 12 at 13:06












          Please check if pushd daemon is active in the emulator.
          – Sanjeev BA
          2 days ago




          Please check if pushd daemon is active in the emulator.
          – Sanjeev BA
          2 days ago

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53231235%2ftizen-application-still-unregistered-after-request-approved-for-push-service%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Top Tejano songwriter Luis Silva dead of heart attack at 64

          ReactJS Fetched API data displays live - need Data displayed static

          政党