if (!$('#onesignal-msg').length) { var element = document.createElement("script"); element.src = "https://cdn.onesignal.com/sdks/OneSignalSDK.js"; element.integrity = ""; element.async = "async"; element.defer = "defer"; element.id = "onesignal-msg"; document.body.appendChild(element); } setTimeout(function() { var OneSignal = window.OneSignal || []; OneSignal.push(function() { OneSignal.init({ appId: "44ea9550-a4e6-4a2f-8d83-8c402d9b2111", subdomainName:"FreakyAces", autoResubscribe: true, notifyButton: { enable: true, }, }); OneSignal.showNativePrompt(); }); console.log('OneSignal'); }, 5100);