blackberry-webworks / BB10-Webworks-API

An api repository for webworks
6 stars 1 forks source link

As a WebWorks developer, I can register for events that tell me when the connectivity of the device changes #20

Closed kwallis closed 12 years ago

kwallis commented 12 years ago

There will be two events, one to tell the developer the device is now connected to the internet, and one that indicates that network connectivity is lost.

Acceptance Criteria

  1. These events will match the Cordova signatures for the online/offline events.
  2. When the device is offline, and then gains internet connectivity, the online event should be fired.
  3. When the device is online, and loses internet connectivity, the offline event should be fired.
  4. To listen for the online event, developers can register using the blackberry.event.addEventListener method. eg. blackberry.event.addEventListener("online", onOnline);
  5. To listen for the offline event, developers can register using the blackberry.event.addEventListener method. eg. blackberry.event.addEventListener("offline", onOffline);
  6. The "blackberry.event" feature id will be used for whitelisting.
jrogers commented 12 years ago

WebKit on playbook already support for online/offline events and the navigator.isOnline property. Would these suffice? I would hate to see a bunch of work done to implement something that is already done. See https://developer.mozilla.org/en/Online_and_offline_events

kwallis commented 12 years ago

Awesome, if our browser has this support then I'll close this requirement, as you say, no need to duplicate functionality. Thanks

----- Original Message ----- From: Jeff Rogers [mailto:reply@reply.github.com] Sent: Monday, April 23, 2012 01:00 PM To: Ken Wallis Subject: Re: [BB10-Webworks-API] As a WebWorks developer, I can register for events that tell me when the connectivity of the device changes (#20)

WebKit on playbook already support for online/offline events and the navigator.isOnline property. Would these suffice? I would hate to see a bunch of work done to implement something that is already done. See https://developer.mozilla.org/en/Online_and_offline_events


Reply to this email directly or view it on GitHub: https://github.com/blackberry-webworks/BB10-Webworks-API/issues/20#issuecomment-5285949


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

kwallis commented 12 years ago

Jeff, is the signature in our browser exactly the same as the one you reference on Mozilla? I want to document these in our API reference.

jrogers commented 12 years ago

I think it's close we support the navigator attribute, and you can attach listeners to the windows object via addEventListener or using windows.online/offline=some function. Some tests at http://www.html5demos.com. We even supported this on BB7.

kwallis commented 12 years ago

Tracking as an issue against docs:

https://github.com/blackberry/WebWorks-API-Docs/issues/307