首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Pushwoosh网在Drupal中的应用

Pushwoosh网在Drupal中的应用
EN

Stack Overflow用户
提问于 2017-05-24 09:48:36
回答 1查看 129关注 0票数 0

我目前正在为Pushwoosh提供浏览器服务,比如Chrome、Safari和Firefox。然而,我尝试这样做的站点是Drupal 7,我的浏览器在Pushwoosh仪表板中启用。但不知何故我无法让它起作用。

我到目前为止所做的事:

  • 将manifest.json文件添加到我的根目录并链接
  • 将服务工作人员添加到我的根目录中

我已经将这段代码添加到我的html.tpl.php中(临时的,当它工作时,我将以更干净的方式添加它)

代码语言:javascript
复制
<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的暂存环境中这样做的,但是需要登录才能访问和查看该网站。这个限制是否可能导致了问题,我在设置中出错了,还是忘记了一些配置?

提前感谢!

EN

回答 1

Stack Overflow用户

发布于 2017-11-07 08:30:57

网络推送不能直接使用http,因此需要https才能使用所描述的解决方案。

然而,Pushwoosh确实有Chrome和Firefox推送,请看本指南- http://docs.pushwoosh.com/docs/chrome-web-push-for-http-websites

希望能帮上忙!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44154815

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档