When I try to do a web push using a simple example for the documentation I get the below error
CleverTap [1678351307444]: Ensure that web push notifications are fully enabled and integrated before requesting them
Before I can use the example and got the push over Chrom, FireFox and Safari, now I only get the error!
<script type="text/javascript">
var clevertap = {event:[], profile:[], account:[], onUserLogin:[], notifications:[], privacy:[]};
// replace with the CLEVERTAP_ACCOUNT_ID with the actual ACCOUNT ID value from your Dashboard -> Settings page
clevertap.account.push({"id": "XXXXXXXXXXXXXX"});
clevertap.privacy.push({optOut: false}); //set the flag to true, if the user of the device opts out of sharing their data
clevertap.privacy.push({useIP: false}); //set the flag to true, if the user agrees to share their IP data
(function () {
var wzrk = document.createElement('script');
wzrk.type = 'text/javascript';
wzrk.async = true;
wzrk.src = 'https://d2r1yp2w7bby2u.cloudfront.net/js/clevertap.min.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wzrk, s);
})();
</script>
<script>
const doPushNotification = () => {
const clevertap = window.clevertap;
let customNotificationPayload = {
msgId: "111111111111111",
};
clevertap.notifications.push({
titleText: "Would you like to receive Push Notifications?",
bodyText:
"We promise to only send you relevant content and give you updates on your transactions",
okButtonText: "Sign me up!",
rejectButtonText: "No thanks",
okButtonColor: "#F28046",
skipDialog: true,
});
}
};
doPushNotification();
</script>
When I try to do a web push using a simple example for the documentation I get the below error
CleverTap [1678351307444]: Ensure that web push notifications are fully enabled and integrated before requesting them
Before I can use the example and got the push over Chrom, FireFox and Safari, now I only get the error!