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
from django.views.generic import TemplateView | |
# Onesignal | |
# TemplateView will render this files as static content | |
urlpatterns += [ | |
path('manifest.json', TemplateView.as_view(template_name='onesignal/manifest.json', content_type='application/json')), | |
path('OneSignalSDKWorker.js', TemplateView.as_view(template_name='onesignal/OneSignalSDKWorker.js', content_type='application/x-javascript')), | |
path('OneSignalSDKWorker.js', TemplateView.as_view(template_name='onesignal/OneSignalSDKWorker.js', content_type='application/x-javascript')), | |
] |
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
// Add this before body close tag. | |
<link rel="manifest" href="/manifest.json" /> | |
<script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" async=""></script> | |
<script> | |
var OneSignal = window.OneSignal || []; | |
// Register the client in onesignal | |
OneSignal.push(function() { |
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
<link rel="manifest" href="/manifest.json" /> | |
<script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" async=""></script> | |
<script> | |
var OneSignal = window.OneSignal || []; | |
// Register the client in onesignal | |
OneSignal.push(function() { | |
OneSignal.init({ | |
appId: "d4fd97fc-xxxx-xxxx-xxxxx-xxxxxxxxx", | |
safari_web_id: 'web.onesignal.auto.08e72fe8-xxxx-xxxx-xxxx-xxxxxxxxxx', |