I need to calculate a delivery price based on location within 5km the price is 10 and each KM after that is 50 cents, so far ive tride the following:
and it kind of works sometimes. im not sure if its the devices im testing it on. i turned on precise location for my PC and the iphone im testing on it aswel. and when i test it using the code testing function it works perfectly. but it doesnt work in practice. it uses the distance of a store (document reference for location in a collection) and global properties device location for the users Lat lang.
is there a better way of doing this or fox it?