Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kwallis opened this issue Apr 23, 2012 · 5 comments
Labels
Milestone

Comments

@kwallis
Copy link

kwallis commented Apr 23, 2012

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
Copy link

jrogers commented Apr 23, 2012

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
Copy link
Author

kwallis commented Apr 23, 2012

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:
#20 (comment)


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
Copy link
Author

kwallis commented Apr 23, 2012

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
Copy link

jrogers commented Apr 23, 2012

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
Copy link
Author

kwallis commented Apr 23, 2012

Tracking as an issue against docs:

blackberry/WebWorks-API-Docs#307

@kwallis kwallis closed this as completed Apr 23, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants