-
Notifications
You must be signed in to change notification settings - Fork 6
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
Error with background geolocation #3
Comments
Any idea ? |
@jeangui i believe the best idea would be to fix this before inserting into the collection.. i'll have a look on the code and see if i can figure out a solution |
Hello, I have not any time to test it but in my mind the best way will be to use the matb33/meteor-collection-hook package with the function .before.insert. Cheers |
I agree, hooks are really nice. I just want to provide an easy and somewhat consistent solution, if this is a common problem. Perhaps an optional extra package to setup the hook for you, or at the very least, an example of the solution. |
Hello @zeroasterisk , Have you got a better solution finally ? cheers |
I don't clearly understand the problem. Please explain with detail and I'll
|
Hello Alan, Thanks a lot for your help. Here are the subject I am dealing with:
Here is the difference in the GeoLog inserted object in terms of structure and information: Here is the code I used in terms of configuration: Here is the code that I commented in order to avoid background stopping by error: Maybe it is related to the function changePace() which is used in the christocracy package sample and not in your meteor package. Have you already tested with IOS device ? Thanks again for your help. jeangui |
Thanks for the information. I honestly haven't looked at it in a little while. I may be dusting it off sometime in the near-ish future, but unfortunately it's not easy to setup and play with. I know at one point it was working as expected with both Android and iOS devices, foreground and background. Maybe, make sure the setup() function isn't called until we have valid information on the device... like maybe not even on For iOS (non-android), I believe the send() callback is maybe where we are "stripping off" the extra details like speed, and accuracy. Instead of this, we should simply be adding on to the object, not stripping off of it. Possible issues:
@jeangui does that all make sense? sound like, related to the things you're dealing with? any chance you want to make your own fork and play with it and see if you can improve it? if not, I will get to it, but it will likely not be for a few weeks. |
Thanks for all those good tips. :) I'll keep you informed of my findings. Cheers |
- [x] send() callback now uses full location object - [x] send() callback now uses this.options.params for userId/uuid/device (if setup) -- because if being called in the background, it probably can't get them then (duh) - [x] setup() not wrapping params setup in a Tracker.autorun() (no idea if this will work on not, needs to be tested... @jeangui) - [ ] test these changes on iOS - [ ] test these changes on Android refs zeroasterisk/meteor-cordova-geolocation-example#3
@jeangui I have put up a commit on a develop branch, which might address these issues --- totally untested... wanna give it a shot? zeroasterisk/meteor-cordova-geolocation-background@b04be8e you should be able to try it out with something like:
when you're done, you can always |
@zeroasterisk Fine ! Thanks a lot for the help. I gonna give a try today. jeangui |
I did quickly a try yesterday but it does not work. Cheers |
@jeangui hey thanks for having a look at this! let me know if you need help with testing / code |
Hello, I haven't found any time to work on it up to now. I gonna try next week. I think I will start from the cristocracy demo app first and then migrate it to meteor before creating a meteor package. May our problem be related to configuration ? mobile-config.js ? Just an idea... I'll keep you informed. cheers |
@jeangui i'm back into this recently, so far only using the standard Geolocation package, which stops reporting when the user locks the phone. i'll keep an eye here, so hopefully i can help somehow |
Hello @hems, https://forums.meteor.com/t/package-creation-issue/5333 I hope I will get something working soon. Best regards |
I tested this package using the cordova example he has: https://github.com/christocracy/cordova-plugin-background-geolocation and it worked perfectly for me on iPhone 5.. does that help? |
Hello henrique, Thanks for your feedback. This is strange. Why it does not work for me. I have may done something wrong when testing. What is your configuration ? cordova ? meteor ? xcode ? So you get the location coordinates on the web site (through the rest api) I gonna give a new test tomorrow. Best regards, jeangui 2015-06-06 18:46 GMT+02:00 henrique matias [email protected]:
|
@jeangui i mean this repository? i just followed readme instructions:
|
Hello @hems Ok I didn't understand you were talking about this repository. thanks. |
Oups. Sorry. I misunderstood again. What I want is to make the thing works in a meteor sample. But I didn't know about christocracy meteor package. 25 days old. regards, jeangui |
Hello,
I have tried the package example (deployment : http://jgl-meteorbggeo.meteor.com).
It does work correctly with the Foreground feature in web & mobile context (I had to change the code for the mobile case).
But I get error when I launch the background thread as depicted in the following screenshot:
https://drive.google.com/file/d/0B1H-jx3teB5-TklOOUp0cDRTQVZDTTNLU1lFbmc4dzN1UE9j/view?usp=sharing
The last 2 geolocations are the ones coming after the background thread launch.
As you can see, the first one does not have any location. It is just a simple json object with only an id.
The second one has latitude, longitude, userid and uuid but there is no location parameter.
What should I modify to make it work. A meteor after insert hook ?
Thanks in advance for the help.
Regards,
The text was updated successfully, but these errors were encountered: