Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Added a "focus-url" property. #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tekkamanendless
Copy link
Contributor

The big problem that I ran into when working with "platinum-push-messaging" on
Android (as a "home screen" app) was that clicking the notification would not
behave as expected.

If the app was closed, then clicking on it opened the app to the desired URL
(the value of the message "url" field). However, if the app was already up
or open in the background, then clicking on a notification simply refocused
the app. This did not trigger the "platinum-push-messaging-click" event, and
it was pretty useless; my app needed the URL to change (it used hash routing).

The service-worker requirement for a 100% exact URL match, while conservative,
does not match with the philosophy of single-page apps. Essentially, if my app
is open anywhere, then it should be focused and sent the click event, which my
app could then handle appropriately.

I've done testing on Chrome 52 for Android and Linux, and everything works as I'd expect it to. If "focus-url" is unspecified (the default), then everything behaves exactly as it did previously.

The big problem that I ran into when working with "platinum-push-messaging" on
Android (as a "home screen" app) was that clicking the notification would not
behave as expected.

If the app was closed, then clicking on it opened the app to the desired URL
(the value of the message "url" field).  However, if the app was already up
or open in the background, then clicking on a notification simply refocused
the app.  This did not trigger the "platinum-push-messaging-click" event, and
it was pretty useless; my app needed the URL to change (it used hash routing).

The service-worker requirement for a 100% exact URL match, while conservative,
does not match with the philosophy of single-page apps.  Essentially, if my app
is open anywhere, then it should be focused and sent the click event, which my
app could then handle appropriately.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant