Last active
July 8, 2016 19:50
-
-
Save flavioso16/1faf14a8f576c4357f91e15c85e3a948 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
(function (d, s, id) { | |
var js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) return; | |
js = d.createElement(s); | |
js.id = id; | |
js.src = "https://sba.argos4.me/Scripts/chrome/chrome_v2.js?v=6"; | |
js.setAttribute('data-name', 'argosScript'); | |
js.setAttribute('path-service-worker', 'https://sba.argos4.me/service-worker.min.js'); // Alterar para o caminho do arquivo service-worker, na raiz da aplicação | |
js.setAttribute('data-app-id', '19'); // Alterar para o ID do aplicativo a ser recebido da Superare | |
js.setAttribute('data-reference-id', 'home'); // Atribuir um nome para segmentação (enviar “” se não houver) | |
js.setAttribute('data-welcome', 'yes'); | |
js.setAttribute('data-welcome-text', 'Texto Bem-vindo'); // Alterar para o texto a ser exibido na notificação de bem-vindo | |
js.setAttribute('data-welcome-title', ‘Título Bem-vindo’); // Alterar para o título a ser exibido na notificação de bem-vindo | |
js.setAttribute('data-welcome-url', 'http://abc.com.br'); // Alterar para a URL na notificação de bem-vindo | |
js.setAttribute('data-welcome-imageURL', 'link-to-image'); // Alterar para imagem da notificação de bem-vindo | |
js.addEventListener('load', function () { | |
var manifest = d.createElement('link'); | |
manifest.rel = 'manifest'; | |
manifest.href = 'https://sba.argos4.me/manifest.json';// Alterar para o caminho do arquivo manifest.json, na raiz da aplicação | |
d.getElementsByTagName("head")[0].appendChild(manifest); | |
argosSubscribeUserChrome(function () { | |
// callback | |
}); | |
}); | |
fjs.parentNode.insertBefore(js, fjs); | |
}(document, 'script', 'argosScript')); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment