Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpush issue, #118

Open
aliaburas80 opened this issue Mar 9, 2023 · 2 comments
Open

Webpush issue, #118

aliaburas80 opened this issue Mar 9, 2023 · 2 comments
Assignees

Comments

@aliaburas80
Copy link

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>
@KambleSonam
Copy link
Collaborator

@aliaburas80 Can you share the test app link which can help us to reproduce the issue ?

@KambleSonam
Copy link
Collaborator

@aliaburas80 Were you able to solve the issue mentioned? Kindly confirm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants