Reputation: 504
I'm currently tying to get Pushwoosh working for browsers, such as Chrome, Safari and Firefox. The site I'm trying to do this for however is a Drupal 7. My browsers are enabled in the Pushwoosh dashboard. But somehow I can't get it to work.
What I've done so far:
I've add this piece of code to my html.tpl.php (temporary when it works I will add it in a cleaner way)
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title><?php print $head_title; ?></title>
<?php print $head; ?>
<link rel="manifest" href="/manifest.json">
<?php print $styles; ?>
<script src="https://cdn.pushwoosh.com/webpush/v3/pushwoosh-web-notifications.js" async></script>
<script>
var Pushwoosh = Pushwoosh || [];
Pushwoosh.push(["init", {
logLevel: 'error', // possible values: error, info, debug
applicationCode: 'MY CODE',
safariWebsitePushID: 'MY ID',
defaultNotificationTitle: 'MY TITLE',
defaultNotificationImage: 'https://cp.pushwoosh.com/img/logo-medium.png',
autoSubscribe: true,
userId: 'user_id',
tags: {
'Name': 'John Smith'
}
}]);
</script>
<?php print $scripts; ?>
<?php print $gtm_datalayer; ?>
<?php print $gtm_script; ?>
</head>
Everything shows up in the website, also my manifest.json is accesible.
However, I'm doing this on a staging environment which has http but a login is needed to acces and see the website. Is it possible that this restriction is causing the problem, did I go wrong in my setup or did I even forget some config?
Thanks in advance!
Upvotes: 0
Views: 146
Reputation: 81
Web pushes do not work with http out of the box, therefore https is required for the described solution to work.
However, Pushwoosh do have Chrome and Firefox http pushes, please take a look at this guide - http://docs.pushwoosh.com/docs/chrome-web-push-for-http-websites
Hope it will help!
Upvotes: 0