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 subscribe to events that will notify me when my application is paused or resumed #5

Closed
kwallis opened this issue Mar 13, 2012 · 14 comments
Labels
Milestone

Comments

@kwallis
Copy link

kwallis commented Mar 13, 2012

The developer will want to be able to perform some logic when their application is put into background mode by the system. Same for when the application returns toi execution (i.e. put in foreground).

Acceptance Criteria

  1. These events should be triggered with the same logic as the rest of the system, and obey the system settings for when an application is actually paused and resumed.
  2. This API should mimic the Cordova signature for these events:
    • a callback can be passed into blackberry.event.addEventListener, associated with a "pause" or "suspend" event.
    • eg. blackberry.event.addEventListener("pause", onPause);
  3. all events will fall into the "blackberry.event" feature id, which will be used for whitelisting.
@nukulb
Copy link
Contributor

nukulb commented Mar 13, 2012

can you post the exact signatures or a link to the documentation?

@kwallis
Copy link
Author

kwallis commented Mar 13, 2012

http://docs.phonegap.com/en/1.5.0rc1/phonegap_events_events.md.html#Events

Ken Wallis
Product Manager ­ BlackBerry WebWorks

Research In Motion
(905) 629-4746 x14369

-----Original Message-----
From: Nukul Bhasin
<reply+i-3629948-df058a29a603ee70ab0e2ba0fb1c5ce10a6fc50b-498318@reply.gith
ub.com>
Date: Tue, 13 Mar 2012 13:37:03 -0700
To: Ken Wallis kwallis@rim.com
Subject: Re: [BB10-Webworks-API] As a WebWorks developer, I can subscribe
to events that will notify me when my application is paused or resumed (#5)

can you post the exact signatures or a link to the documentation?


Reply to this email directly or view it on GitHub:
#5 (comment)
ment-4485573


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.

@efidler
Copy link

efidler commented Mar 20, 2012

page visibility, perhaps? http://www.w3.org/TR/2011/WD-page-visibility-20110602/

@nukulb
Copy link
Contributor

nukulb commented Mar 27, 2012

@efidlerrim Are you suggesting we use the page Visibility signature or we implement a webworks api based on this existing webkit event?
Is this event available in PB2.0?

@efidler
Copy link

efidler commented Mar 27, 2012

it seems like (at least some of) this functionality basically duplicates Page Visibility, so why not use it? We don't have it on PB2.0.

@kwallis
Copy link
Author

kwallis commented Mar 27, 2012

Does our implementation of page visibility reflect the actual state of the
application, and does it respect the different settings the user can

configure for if/when the application execution is actually paused?

Ken Wallis
Product Manager ­ BlackBerry WebWorks

Research In Motion
(905) 629-4746 x14369

-----Original Message-----
From: "Eli Fidler (RIM)"
<reply+i-3629948-df058a29a603ee70ab0e2ba0fb1c5ce10a6fc50b-498318@reply.gith
ub.com>
Date: Tue, 27 Mar 2012 08:57:34 -0700
To: Ken Wallis kwallis@rim.com
Subject: Re: [BB10-Webworks-API] As a WebWorks developer, I can subscribe
to events that will notify me when my application is paused or resumed (#5)

it seems like (at least some of) this functionality basically duplicates
Page Visibility, so why not use it? We don't have it on PB2.0.


Reply to this email directly or view it on GitHub:
#5 (comment)
ment-4719712


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.

@efidler
Copy link

efidler commented Mar 27, 2012

Should do.

Eli

On 3/27/12 12:13 PM, "Ken Wallis"
<reply+i-3629948-7a256d2cee264a5ad6db69b89f1e497440d78c8c-415600@reply.gith
ub.com> wrote:

Does our implementation of page visibility reflect the actual state of the
application, and does it respect the different settings the user can

configure for if/when the application execution is actually paused?

Ken Wallis
Product Manager ­ BlackBerry WebWorks

Research In Motion
(905) 629-4746 x14369

-----Original Message-----
From: "Eli Fidler (RIM)"
<reply+i-3629948-df058a29a603ee70ab0e2ba0fb1c5ce10a6fc50b-498318@reply.git
h
ub.com>
Date: Tue, 27 Mar 2012 08:57:34 -0700
To: Ken Wallis kwallis@rim.com
Subject: Re: [BB10-Webworks-API] As a WebWorks developer, I can subscribe
to events that will notify me when my application is paused or resumed
(#5)

it seems like (at least some of) this functionality basically duplicates
Page Visibility, so why not use it? We don't have it on PB2.0.


Reply to this email directly or view it on GitHub:
#5 (comment)
m
ment-4719712


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.


Reply to this email directly or view it on GitHub:
#5 (comment)
ment-4720125


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.

@rwmtse
Copy link

rwmtse commented Mar 27, 2012

@kwallis I am currently working on the implementation. What we do currently is we define a callback that gets invoked by the web launcher whenever the window state is changed. The web launcher calls this callback with 3 possible window states: fullscreen, thumbnail, or invisible. The code would trigger the onPause callback whenever window state == thumbnail, or the onResume callback whenever state == fullscreen.

@kwallis
Copy link
Author

kwallis commented Mar 27, 2012

This is dependent on the system setting though?

Settings -> General -> Application Behavior.

If you select Showcase or Default, the app would still be running even in
thumbnail. For Showcase, it would never be paused at all.

We need these settings to be respected. Does the web launcher, or
something below it, respect these settings and only fire the window states
under the right circumstances? If not, then window state may not be the

right indicator of the application behavior.

Ken Wallis
Product Manager ­ BlackBerry WebWorks

Research In Motion
(905) 629-4746 x14369

-----Original Message-----
From: Rosa Tse
<reply+i-3629948-df058a29a603ee70ab0e2ba0fb1c5ce10a6fc50b-498318@reply.gith
ub.com>
Date: Tue, 27 Mar 2012 11:42:19 -0700
To: Ken Wallis kwallis@rim.com
Subject: Re: [BB10-Webworks-API] As a WebWorks developer, I can subscribe
to events that will notify me when my application is paused or resumed (#5)

@kwallis I am currently working on the implementation. What we do
currently is we define a callback that gets invoked by the web launcher
whenever the window state is changed. The web launcher calls this
callback with 3 possible window states: fullscreen, thumbnail, or
invisible. The code would trigger the onPause callback whenever window
state == thumbnail, or the onResume callback whenever state == fullscreen.


Reply to this email directly or view it on GitHub:
#5 (comment)
ment-4723399


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.

@rwmtse
Copy link

rwmtse commented Mar 27, 2012

I've tested it. window states aren't tied to Application Behaviour. I would need to find another way to do it.

@rwmtse
Copy link

rwmtse commented Mar 27, 2012

@kwallis I found that WebWorks for PB implemented onForeground/onBackground API based on window state before. I checked the code. It relies on flash.events.Event.activate/deactivate. This is the description for the activate event in Flash documentation: "Dispatched when the Flash Player or AIR application gains operating system focus and becomes active"
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/EventDispatcher.html#event:activate

@kwallis
Copy link
Author

kwallis commented Mar 27, 2012

This does not necessarily equate to the window state that you outlined
before. I think we would need to know what native event/trigger the AIR

code is actually relying on to know if it is what window state is?

Ken Wallis
Product Manager ­ BlackBerry WebWorks

Research In Motion
(905) 629-4746 x14369

-----Original Message-----
From: Rosa Tse
<reply+i-3629948-df058a29a603ee70ab0e2ba0fb1c5ce10a6fc50b-498318@reply.gith
ub.com>
Date: Tue, 27 Mar 2012 13:33:03 -0700
To: Ken Wallis kwallis@rim.com
Subject: Re: [BB10-Webworks-API] As a WebWorks developer, I can subscribe
to events that will notify me when my application is paused or resumed (#5)

@kwallis I found that WebWorks for PB implemented
onForeground/onBackground API based on window state before. I checked the
code. It relies on flash.events.Event.activate/deactivate. This is the
description for the activate event in Flash documentation: "Dispatched
when the Flash Player or AIR application gains operating system focus and
becomes active"
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/e
vents/EventDispatcher.html#event:activate


Reply to this email directly or view it on GitHub:
#5 (comment)
ment-4725710


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.

@erhorim
Copy link

erhorim commented Apr 25, 2012

Feature implemented by blackberry-webworks/BB10-WebWorks-Framework#16

@kwallis
Copy link
Author

kwallis commented May 7, 2012

Released

@kwallis kwallis closed this as completed May 7, 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

5 participants