背景地理位置ServiceWorker - on Webessing Web App重新获得焦点时的事件顺序 [英] Background Geolocation ServiceWorker - onMessage Event order when Web App regains focus

查看:104
本文介绍了背景地理位置ServiceWorker - on Webessing Web App重新获得焦点时的事件顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关完整的详细信息和更详细的说明,请参阅此W3C服务工作人员问题

For complete details, and a more lengthy description, please refer to this W3C Service worker issue.

这是我的HTML5 Web App场景: -

This is my HTML5 Web App scenario: -


  • 当我去旅行时,我的网络应用程序已经背景并卡在我的口袋里

  • 当我为知识管理员计时时,我的服务人员定期接收GPS更新和调用postMessage()将我们的应用程序排队等待最终在Google地图上绘图

  • 在骑行结束时,我点了一杯啤酒并展示了网络应用程序,这样我才能看到我在哪里已经,平均速度,等等。

我的问题是: -

1)Focus事件会在ServiceWorkers触发的所有Message事件之前或之后触发吗?

1) Will the Focus event fire before or after all of the Message events triggered by the ServiceWorkers?

2)如果Focus是第一个将是setTimer(0) ,backlogCleared)足以作为建立所有背景的启发机制处理的东西?

2) If Focus is first will a setTimer(0,backlogCleared) suffice as a heuristic mechanism to establish "all background stuff dealt with"?

3)无论如何都要折叠postMessage()消息(模式Firebase的推送通知),以便只接收最后/当前消息?

3) Is there anyway to collapse the postMessage() messages (al la mode Firebase's push notifications) so that only the last/current message is received?

4)如果您对授权后台地理定位所需的权限有任何想法,请在W3C上添加。

4) If you have ideas about the permissions required to authorize background geolocation please add them over at W3C.

干杯和好骑马,跑步,帆船,开车!

Cheers and good riding, running, sailing, driving!

推荐答案

我的Brotkrumen Ultimate Web App现已完成。所有源/图像文件都可以在 https://drive.google.com/open?id=找到0B7Rmd3Rn8_hDNW1zSWRoXzBTclU

My Brotkrumen Ultimate Web App is now complete. All source/image files can be found at https://drive.google.com/open?id=0B7Rmd3Rn8_hDNW1zSWRoXzBTclU

最重要的设计/建议规格变更是TravelManager订阅现在应该是客户特定的。 TravelEvent必须包含预期的Client.id(TravelEvent.source.id)。这意味着UA必须监控和过滤每个客户端的GeoLocation更新。我还添加了新的演示功能,例如按下到达按钮时显示的行程摘要。也可以按Map Trip或Replay将行程重播到Google地图上。如果旅行的最后和下一个地理位置更新都在地图窗口中可见,则通过CSS过渡实现平滑的标记移动。

Most important design/proposed-specification change is that TravelManager subscription should now be Client specific. The TravelEvent must contain the intended Client.id (TravelEvent.source.id). This means that the UA must monitor and filter GeoLocation updates per client. I have also added new demo functionality such as a Trip Summary that is displayed when you press the "Arrive" button. The trip can also be replayed onto Google Maps by pressing "Map Trip" or "Replay". If the last and next geolocation updates for the trip are both visible in the Map window then smooth Marker movement is achieved via CSS transitions.

帮助背景GeoLocation启动并帮助Web Apps与Native Apps竞争!

PLEASE help Background GeoLocation get up and help Web Apps compete with Native Apps!

如果我的TravelManager解决方案设计有问题,请告诉我。撕裂它!

If there is something wrong with my TravelManager solution design then let me know. Tear holes in it!

这篇关于背景地理位置ServiceWorker - on Webessing Web App重新获得焦点时的事件顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆