Open jeangui opened 9 years ago
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. Moreover it will be nice to have a flag on the object sent to the server with the context (FG, BG, android, ios, ...). By this way it will easier to do the transformation on the fly before inserting.
Cheers @jeangui
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 @jeangui
I don't clearly understand the problem. Please explain with detail and I'll see what I can come up with. On Wed, Apr 8, 2015 at 3:07 AM jeangui notifications@github.com wrote:
Hello @zeroasterisk https://github.com/zeroasterisk ,
Have you got a better solution finally ?
cheers
@jeangui https://github.com/jeangui
— Reply to this email directly or view it on GitHub https://github.com/zeroasterisk/meteor-cordova-geolocation-example/issues/3#issuecomment-90826085 .
Hello Alan,
Thanks a lot for your help. I have several problem finally. So maybe this is not the best place to discuss about it here.
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 Meteor.startup()
but check in the client that you can get to the UUID
, and then run setup()
?
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:
setup()
callback should come with some easy way to defer until there's a valid UUID of the device.send()
callback should be sending the userId, uuid, device
options configured in setup vs trying to look them up, while in the backgroundsend()
callback should be extending location
as the data, not only plucking off the lat/ln.@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.
@zeroasterisk
Thanks for all those good tips. :) I gonna try to defer the setup function. Maybe It would be better to do a fork in order to start from a new basis. Especially I have a question concerning your choice of using the romainstrock cordova plugin instead of the christocracy one directly. Is there a special reason ?
I'll keep you informed of my findings.
Cheers Jeangui
@jeangui I have put up a commit on a develop branch, which might address these issues --- totally untested... wanna give it a shot?
you should be able to try it out with something like:
cd yourapp
mkdir packages
cd packages
git clone https://github.com/zeroasterisk/meteor-cordova-geolocation-background "zeroasterisk:cordova-geolocation-background"
cd "zeroasterisk:cordova-geolocation-background"
git checkout develop
git pull origin develop
cd ../..
meteor
when you're done, you can always rm -rf packages/zeroasterisk:cordova-geolocation-background
@zeroasterisk Fine ! Thanks a lot for the help. I gonna give a try today. I'll tell you the result of my testing. I don't have any android device unfortunately.
jeangui
Hi @zeroasterisk
I did quickly a try yesterday but it does not work. You can see the result here : http://jgl-meteorbggeo.meteor.com/ There are some bugs that I have already corrected (the OPTION HTTP request should not induce an insert in the geolog collection for instance). I gonna try to change some code this week if I get some time to do so.
Cheers jeangui
@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
@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, Finally I haven't got so much time to look at it. Thanks to your post, I tried to get further but I am blocked on the following problem:
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) even when using the background mode ?
I gonna give a new test tomorrow.
Best regards,
jeangui
2015-06-06 18:46 GMT+02:00 henrique matias notifications@github.com:
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?
— Reply to this email directly or view it on GitHub https://github.com/zeroasterisk/meteor-cordova-geolocation-example/issues/3#issuecomment-109616228 .
@jeangui i mean this repository?
i just followed readme instructions:
cd example/SampleApp
$ cordova plugin add https://github.com/christocracy/cordova-plugin-background-geolocation.git
$ cordova platform add ios
$ cordova build ios
Hello @hems
Ok I didn't understand you were talking about this repository. I didn't know that Christocracy did create a meteor package. I gonna test it.
thanks. jeangui
Oups. Sorry. I misunderstood again. yes I did know the cordova plugin that Christocracy built up. I did already test the SampleApp with cordova only. And it works perfectly for me as well.
What I want is to make the thing works in a meteor sample. @zeroasterisk did a package for achieving this. But it does not work well for me. Maybe I am doing things not in the correct way (in addition, since IOS 8.3 the behavior is even worse).
But I didn't know about christocracy meteor package. 25 days old. It help me about my package version number. It is fine now when I add the cordova package in meteor. I don't have so much time but I am trying to make the @zeroasterisk works with christocracy new meteor package. Right now I have still errors.
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,