我目前正在为Pushwoosh提供浏览器服务,比如Chrome、Safari和Firefox。然而,我尝试这样做的站点是Drupal 7,我的浏览器在Pushwoosh仪表板中启用。但不知何故我无法让它起作用。
我到目前为止所做的事:
我已经将这段代码添加到我的html.tpl.php中(临时的,当它工作时,我将以更干净的方式添加它)
<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>
所有的东西都出现在网站上,我的manifest.json也是可访问的。
但是,我是在一个有http的暂存环境中这样做的,但是需要登录才能访问和查看该网站。这个限制是否可能导致了问题,我在设置中出错了,还是忘记了一些配置?
提前感谢!
发布于 2017-11-07 08:30:57
网络推送不能直接使用http,因此需要https才能使用所描述的解决方案。
然而,Pushwoosh确实有Chrome和Firefox推送,请看本指南- http://docs.pushwoosh.com/docs/chrome-web-push-for-http-websites。
希望能帮上忙!
https://stackoverflow.com/questions/44154815
复制相似问题