Open dotnetwise opened 10 years ago
Here's an Example app: https://github.com/zeroasterisk/meteor-cordova-geolocation-example
It's very basic atm, but proves the concept.
I don't have a "published" version yet, nor any "apps" to show.
If you would like to "extend" or "improve" my Example app, pull-requests are very welcome!
If more interest in this, I may devote more time to building out examples.
@zeroasterisk when running the demo app or trying to roll my own little one, i get an error on XCode
2015-03-23 00:28:01.840 app[447:85900] ERROR whitelist rejection: url='http://localhost:3000/sockjs/info?cb=o9tkdoh24a'
Any ideas of what might be the issue?
that's prob a new feature of Meteor+Cordova. You've gotta allow those URLs. http://docs.meteor.com/#/full/App-accessRule
@zeroasterisk perhaps you could add instructions on the readme file then ?
Sorry i'm completely new to meteor, would be something like this ?
App.accessRule( 'http://mydomain.com', { external: true } );
probably just:
App.accessRule( 'http://mydomain.com');
Since you want it handled locally (by meteor), not externally (by the phone/other-apps).
Please let me know how it goes... I'll update the docs if this does fix it.
Also, just to be sure you know this, the above App config goes in <app-root>/mobile-config.js
@zeroasterisk funny enough i tried your example now, and it runs on my phone without any errors on xCode.
But when navigating to: https://geolocationbackgroundexample.meteor.com i just see this:
My example ( i tried implementing something from "scratch" ) still have the problem with accessing localhost, and for some weird reason i can't get through the initial page.
I'll investigate more on my side, it seems that i have some weird problems.
Does running https://github.com/zeroasterisk/meteor-cordova-geolocation-example in your iphone yields perfect results?
Hello @hems,
I have got the same problem as you and I post an issue on it.
https://github.com/zeroasterisk/meteor-cordova-geolocation-example/issues/3
I think this is related to the data structure that is proposed by the iphone version of the background service. The location attribute is not located at the same level. Depending on the running context (FG, BG, IOS, Android) the data structure is different. So the meteor server has to be able to transform the data on the fly.
I have been thinking to use matb33/meteor-collection-hooks.
Regards, @jeangui
Data structure difference: I did that.
On Monday, March 30, 2015, jeangui notifications@github.com wrote:
Hello @hems https://github.com/hems,
I have got the same problem as you and I post an issue on it.
zeroasterisk/meteor-cordova-geolocation-example#3 https://github.com/zeroasterisk/meteor-cordova-geolocation-example/issues/3
I think this is related to the data structure that is proposed by the iphone version of the background service. The location attribute is not located at the same level. Depending on the running context (FG, BG, IOS, Android) the data structure is different. So the meteor server has to be able to transform the data on the fly.
I have been thinking to use matb33/meteor-collection-hooks.
Regards, @jeangui https://github.com/jeangui
— Reply to this email directly or view it on GitHub https://github.com/zeroasterisk/meteor-cordova-geolocation-background/issues/1#issuecomment-87591766 .
Snet from Gmail Mobile
Hello @christocracy
thanks for your feedback. I gonna use therefore the meteor package matb33/meteor-collection-hooks.
Best regards
@jeangui
I'd love to see your finished/fixed example.
@christocracy sorry i got a bit confused, what you mean by "i did that" ?
Did you fix this issue on your package https://github.com/christocracy/cordova-plugin-background-geolocation ? If i'm not mistaken that is the package @zeroasterisk used under the hood here?
I'm responsible for the difference in data-structure from Cordova's Geolocation plugin (ie: location.coords)
On Monday, March 30, 2015, henrique matias notifications@github.com wrote:
@christocracy https://github.com/christocracy sorry i got a bit confused, what you mean by "i did that" ?
Did you fix this issue on your package https://github.com/christocracy/cordova-plugin-background-geolocation ? If i'm not mistaken that is the package @zeroasterisk https://github.com/zeroasterisk used under the hood here?
— Reply to this email directly or view it on GitHub https://github.com/zeroasterisk/meteor-cordova-geolocation-background/issues/1#issuecomment-87848108 .
Snet from Gmail Mobile
@christocracy and you think would be a good idea to standardize this? any tips on how to get started "fixing" our issue ?
If we have to translate the data FROM this plugin, I think it would have to be on the AJAX receiver on the server... which is not currently implemented as part of this plugin, only as code examples, etc...
If you can give me what JSON we are getting across all possible versions of the plugin (as examples)?
I think making a basic translation method for easy inclusion on the AJAX receiver would be a good idea, and easy.
(If I'm misunderstanding the issue, please set me straight)
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 - I love the "hooks" approach... but if it's a common problem, I'd like to bundle a common solution with this package, or as an optional but easy secondary package.
A live example / perhaps published in appstore / google play would be wonderful.