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 may save these IDs in your system and later push notifications against these IDs.

Definition

window._izq.push(["register_callback",function(obj){if(obj.statuscode==1){ //Code to write response to database //Save user IDs who subscribe to notifications basis user response to your 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 help answer your question?

thumbs up
thumbs down

Thanks for the feedback! 🙏🏽