Register callback function

Getting response in callback

For every website visitor, you can get the response for subscription prompt i.e. whether the user subscribed to notifications or blocked them. All other responses are mentioned below in Responses. The objective of the callback function is to let you know which all visitors subscribed to notifications so that you can act on them accordingly.

Definition

window._izq.push(["register_callback",function(obj){
if(obj.statuscode==1)
{
 //Code to write response to database
}}]);

Sample Response

{"response":"subscribed","statuscode":1}
{"response":"already subscribed","statuscode":2}
{"response":"blocked","statuscode":3}
{"response":"already blocked","statuscode":4}
{"response":"browser not supported","statuscode":5}
{"response":"prompt closed","statuscode":6}
{"response":"unsubscribed","statuscode":7}

Sample Code

window._izq.push(["register_callback",function(obj){
if(obj.statuscode==1)
{
 console.log("Current Status : "+obj.response);
}
}]);

Did this page help you?