<script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" async='async'></script> <script> var OneSignal = window.OneSignal || []; OneSignal.push(["init", { appId: "ee729955-975d-43d1-9ec4-ca63d887320e", autoRegister: true, /* Set to true to automatically prompt visitors */ subdomainName: 'lifo', notifyButton: { enable: false /* Set to false to hide */ } }]); </script>
<a href="#" id="subscribe-link" style="display: none;"> <img src="http://i.giphy.com/3oz8xWcI2AARlRFCfu.gif" alt="Εγγραφείτε για να λαμβάνετε ενημερώσεις" height="250" width="300"> </a> <script> function subscribe() { OneSignal.push(["registerForPushNotifications"]); event.preventDefault(); }
var OneSignal = OneSignal || []; /* This example assumes you've already initialized OneSignal */ OneSignal.push(function() { // If we're on an unsupported browser, do nothing if (!OneSignal.isPushNotificationsSupported()) { return; } OneSignal.isPushNotificationsEnabled(function(isEnabled) { if (isEnabled) { // The user is subscribed to notifications // Don't show anything } else { document.getElementById("subscribe-link").addEventListener('click', subscribe); document.getElementById("subscribe-link").style.display = ''; } }); }); </script>