gpt4 book ai didi

ios - 推送不起作用(错误 : Could not get)

转载 作者:行者123 更新时间:2023-11-28 22:09:03 26 4
gpt4 key购买 nike

尝试使用 Ratchet 的 push.js,但不起作用。我在控制台中有什么:

[Error] Error: Could not get: file:///var/mobile/Applications/337585D8-89E1-4810-AB37-0A6DD2DA3A34/Gustav.app/www/booking.html
failure (ratchet.js, line 446)
onreadystatechange (ratchet.js, line 371)

如果您点击链接十次,您将开始收到此信息:

[Error] TypeError: 'undefined' is not an object (evaluating 'cacheMapping[PUSH.id].url')
cachePush (ratchet.js, line 202)
PUSH (ratchet.js, line 392)
touchend (ratchet.js, line 258)

所有这些控制台数据均来自真实设备测试 (iOS 7.1),包装器是 Cordova CLI 3.4.1-0.1.0。

文件 booking.html 存在,像这样的原生 safari 失败

[Error] Failed to load resource: The requested URL was not found on this server. (menu.html, line 0)

没有出现。

最佳答案

push.js不支持 file://协议(protocol)。

Ratchet uses XHR requests to fetch additional pages inside the application. Due to security concerns, modern browsers prevent XHR requests when opening files locally (aka using the file:// protocol); consequently, Ratchet does not work when opened directly as a file. A common solution to this is to simply serve the files from a local server. One convenient way to achieve this is to run python -m SimpleHTTPServer to serve up the files in the current directory to http://localhost:<port>

另见 this issuethis issue提交到Github

这似乎是使用 Cordova 和 Ratchet 的常见问题。

关于ios - 推送不起作用(错误 : Could not get),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23291727/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com