Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Add support for reporting location to server URL when specific GCM/APN arrives #6

Open
uriva opened this issue May 28, 2015 · 9 comments

Comments

@uriva
Copy link

uriva commented May 28, 2015

Hi,
I have code that adds the following functionality (as of now just on android):
Upon a GCM with REPORT_LOCATION in a certain field, the client sends its current location via http request to a predetermined endpoint (without bothering the user).
(It can't be done from javascript because the app is not always active)
This is useful when the server needs accurate client location in a specific time, but periodically updating the server costs precious battery.

Does this sound like something you'd like to incorporate?
Is this plugin currently up and and working?

@macdonst
Copy link
Member

macdonst commented Jun 3, 2015

@uriva Yes, this plugin is currently up and working. It sounds interesting but I'd like to see support for Android, iOS and soon to be Windows Phone before adding it as a new feature.

@uriva
Copy link
Author

uriva commented Jun 8, 2015

gotcha

@uriva uriva closed this as completed Jun 8, 2015
@macdonst
Copy link
Member

macdonst commented Jun 9, 2015

@uriva you don't need to close this issue but we could move it to an enhancement.

@uriva uriva changed the title reporting location via gcm Add support for reporting location to server URL when specific GCM/APN arrives Oct 5, 2015
@uriva
Copy link
Author

uriva commented Oct 5, 2015

Reopening as I see my current master push-plugin repository is deprecated, so I prefer to add to this one. Please add to enhancements.

I can write only the Android case, because I don't have knowledge / tools for iOS or Windows.
Is anybody up for it?

@uriva uriva reopened this Oct 5, 2015
@fredgalvao
Copy link
Collaborator

The cold-start background notification feature, specifically the event proposed here would already make that possible without having to resort to extra native code, and would already work on all platforms. And I'd rather it be on javascript side, so that any customizations to the request made to the server could be done easily.

@uriva
Copy link
Author

uriva commented Oct 6, 2015

iiuc, this functionality is currently available in android, and the issue is just for ios?

@fredgalvao
Copy link
Collaborator

No, unfortunately it's not available in any platform yet.

@uriva
Copy link
Author

uriva commented Oct 6, 2015

/:

@uriva
Copy link
Author

uriva commented Feb 20, 2016

There are two issues that prevents #93 from being a complete solution:

  1. The functionality isn't available if a user "ends task" through the square button (no deal breaker and I saw that there are other issues debating this)
  2. If you call navigator.geolocation.getCurrentPosition from the pushPlugin callback, it will not work (the callback given to getCurrentPosition won't get called) until the user has actually entered the app.

I know that you guys are aware of the first issue, but perhaps the second one is new information. If you have any ideas how to bypass this that would be great, e.g. if we can make android think this is foreground javascript somehow (I assume that natively that call would have been allowed from a background process?)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants