In the last video we managed to get some console logs of a user's location changing over time.
Now at this point I just want to mention very quickly that you do not have to use this test file that
we put together over here at the MOCA location stuff.
The only reason we put this together is so that you can very easily test out this application if you're
on a physical device so you don't have to like walk around the world if you're on an emulator or simulator
you do not have to use it.
However like I mentioned I have ran into a lot of issues trying to get location work on the IWM emulator
in particular.
So at present I just console logged or I commented out the mock location import right there.
So I no longer am running all that fake location data.
Now if I refresh my application and go back over and track create you'll notice that back over here
I get absolutely no console logs for an update location if I go up to debug up here and then go to location.
You'll notice that I have freeway drive on freeway drive should indicate that my location is changing
like once per second and that I'm somehow like driving along freeway to 80 right here.
If I change this over to like city run however and then refresh the application and come back to track
create well still nothing over here let me try it one more time I'm gonna try this time city bicycle
ride I'll refresh and go to track create and now you'll see that I'm getting some console logs here
and I'm getting one just not one per second.
This is some once again fake location information that's coming from the Iaw emulator.
In other words it's simulating a city bicycle ride.
It's not using the test data from our mock location file.
Now as you just saw when I had selected either city run or freeway drive I was getting no console logs
at all.
So my point here is that at this point in time depending upon what device you're using to run the application
it's kind of up to you to either try to use this built in location stuff on the Iaw device or on the
android emulator or just use that test file.
There's not really a right way to do this and this is really getting into the realm of React Native
where unfortunately sometimes things just really don't work that well.
So at this point moving forward you just need to decide for yourself.
Either use that test data or if you're on an OS or Android simulator you can rely upon this location
setting right here.
But like I just said it is really finicky.
For me personally.
So that's why I choose to use the test data to make sure that this location stuff works 100 percent
the time when I'm actually trying to test it.
So for me I'm going to change this location right here too just like none.
And I'm going to rely entirely on the mock location test data.
So once again pulled up to you which one you use if you're on a physical device.
I really think that you're going to end up using mock location if you are on a physical device and you're
using mock location you might try updating the longitude and latitude right here to your physical location.
Otherwise you're going to see the map kind of like jumping around as it tells you what your location
is and then it tries to update that or or overwrite that with the Apple headquarters longitude latitude
you'll see that in action very quickly.
OK.
So once again just want to throw that quick note out here this location stuff really finicky kind of
buggy.
Nonetheless it's the best thing we have.
So now that we've got this stuff out of the way let's take a quick pause and start recording all this
location data so quick pause.
I'll see you in just a minute.