So now for the important part,
testing this on a real phone. For this, I'm reinstalling the expo client on my iPhone so that all the permissions
I did set up there in the past during testing and so on are reset so that they can show this from scratch
and I opened up my expo dev window in the browser here, it was always open but now I brought it on
the screen so that we have the barcode there to scan.
So with that, we can of course scan this with the help of the camera application here which I point
that the barcode so that I can tap this to open it, on Android you have the scanner in the expo app
but I'll show this in a second.
Got that,
here's the app and now I can add a place, test this
and now you'll see something interesting.
If I click take image, I'm asked for permissions and I click
okay but now this will actually fail.
You see that warning here at the bottom,
this failed.
Now the reason for why this failed is that I'm asking for the wrong permission here in the image
picker.
Now previously, I had to change this because on the simulator, I was also getting an error
there. Now this should actually be fixed by not just asking for the camera roll permission here but also,
we can simply add a second argument here, for permissions camera,
so we need both - camera and camera roll.
Now previously, changing this to camera roll fixed the issue because we did ask for the camera permission
first but in the end, you need to ask for both and whenever you reinstall the expo client or relaunched
the app on a new device, you definitely need to ask for both
for this to work. So make sure you do ask for both
and with that added, with both permissions added here,
this will now always work because now we're asking for both permissions even though we're only using
the camera here
but since this package could also use the camera roll, we need to get both permissions and thereafter,
close expo and rescan that barcode here,
like this and open this in expo again and now it should work.
So now if we go here and we enter test here and then I take an image, now I'm asked for whether I want
to grant access and I do and now I'll take this amazing image here which is very meta because I take
an image of the screen where I record that I take an image and I can use that photo,
here it is and now let's choose a location on the map,
maybe this one, save
this, seems to work or get my current location which I don't want to here, so I'll just click
save place
and here it is, add it, you can view it, you can view the details.
So this seems to work
and now let me also close this and reopen it so that we see whether it was really stored in a database.
So it should now load this place hopefully and it does and all the data is there.
So this is now our application running on a real iPhone and we fixed this important permission error,
let's now also run it on an Android device.