【问题标题】:Pushwoosh Web SDK not working in ES5Pushwoosh Web SDK 在 ES5 中不起作用
【发布时间】:2016-07-22 06:42:07
【问题描述】:

我正在使用 Pushwoosh Web SDK 2.0^ 注册我的设备(浏览器)ID。并得到它的令牌,但是对象没有被构造,因为 Pushwoosh 正在使用 ES6 并承诺,而我在我的项目中使用 ES5。有没有办法获取 PushWoosh 对象,以便我可以在他们的 SDK 中使用其他 API?

我关注了Web Push SDK 2.0,但this 对我没有用。

PS:我在前端使用 Angular 1.5。

谢谢

【问题讨论】:

    标签: angularjs web ecmascript-6 babeljs pushwoosh


    【解决方案1】:

    所有支持网络推送的浏览器也支持 Promise。 您可以使用编译后的源代码:

    • git clone git@github.com:Pushwoosh/web-push-notifications.git
    • cd web-push-notifications && npm install
    • npm run build:lib
    • 从 lib/ 目录获取源代码并复制到您的项目中

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-03
      • 2015-11-18
      • 2018-05-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多