OneSignal.push(function() { OneSignal.init({ appId: "bf34cd72-b37b-494f-be8e-50feb194dcb5", safari_web_id: "web.onesignal.auto.613528e9-2930-4b07-a098-5a9518822d98", notifyButton: { enable: true, }, promptOptions: { customlink: { enabled: true, /* Required to use the Custom Link */ style: "button", /* Has value of 'button' or 'link' */ size: "medium", /* One of 'small', 'medium', or 'large' */ color: { button: '#E12D30', /* Color of the button background if style = "button" */ text: '#FFFFFF', /* Color of the prompt's text */ }, text: { subscribe: "Subscribe to push notifications", /* Prompt's text when not subscribed */ unsubscribe: "Unsubscribe from push notifications", /* Prompt's text when subscribed */ explanation: "Get updates from all sorts of things that matter to you", /* Optional text appearing before the prompt button */ }, unsubscribeEnabled: true, /* Controls whether the prompt is visible after subscription */ } }, }); });
function tagButtonClick() { var postid = document.querySelector('.status-publish').getAttribute('id').replace("post-", ""); console.log("Tag Button Clicked"); OneSignal.push(function() { OneSignal.sendTag(postid, "3").then(function(tagsSent) { console.log("tagsSent: " + tagsSent.postid); }); });
}