Repository navigation
Issue 2
This issue was something we notice when testing the software and it is not on its GitHub issue page.
It was happening only on Safari on iOS 13 and superior.
The program behaviour that inspires this fix was, when using certain libraries, before asking to grant camera permissions, an alert was being emitted asking to touch the screen after the camera permission alert, to activate geolocation, without asking or even give the option, to grant that permission.
- As a user, I want to use the system with the minimum number of alerts in order to have a good experience.
- As a user, I want to be asked to grant some type of permission.

This fix was applied to two source code files, aframe/src/location-based/gps-projected-camera.js and aframe/src/location-based/gps-camera.js. When they are build three files are created/updated:
- aframe/build/aframe-ar.js;
- aframe/build/aframe-ar-nft.js;
- aframe/build/aframe-ar-location-only.js.
As asking the user to tap the screen after a permission prompt is emitted is not ideal, we decided to change the code to not only remove that alert, but also to create a permission window that ask the user to grant the geolocation permission. After a bit of research on this topic, we choose to ask the user to grant the geolocation permission to the website instead of asking to tap the screen to activate it. This way he not only has the option to deny it, but he also knows that he’s granting that permission, since before it was ambiguous. After this fix, the program behaviour is asking to grant the permission right away, instead of waiting for a touch on the screen after the camera permission prompt.
In the following image it's possible to see the original code:

To fix the issue it was necessary to remove the handler function and remove the event listener that awaits the tap on the alert. It's possible to see the changes on the following image:

A pull request was submitted on the project GitHub page and it can be found at https://github.com/AR-js-org/AR.js/pull/269.