AR-js-org / AR.js

Image tracking, Location Based AR, Marker tracking. All on the Web.
MIT License
5.3k stars 909 forks source link

[solved] GPS AR ok in Android Firefox , coordinates not passing in anywhere else in Android and iOS browsers #558

Closed herrpedro closed 10 months ago

herrpedro commented 11 months ago

Do you want to request a feature or report a bug? -> bug, I hope.

https://gitter.im/AR-js returns http404

What is the current behavior? https://panoramapalace.com/preview/mindar/quiztest.html works on firefox android , shows the ARcontent but camera is white in firefox iOS , camera works but does not show AR contente at all

If the current behavior is a bug, please provide the steps to reproduce. added simulateLatitude and simulateLongitude to help. just open the link with some browser. It asks for permitions and then nothing happens. all the code is there in quiztest.html , I did not add server side yet till i get this stable

Please mention other relevant information such as the browser version, Operating System and Device Name Android and iOS devices

What is the expected behavior? i'd like this to work cross browser. screenshots of some browsers and a screencast of firefox android working here -> https://drive.google.com/drive/folders/1_g7ZKaiuxYsGdOLzM_ZU21IXgeZ3PMDL?usp=sharing

Thank you for your help and work.

If this is a feature request, what is motivation or use case for changing the behavior?

herrpedro commented 11 months ago

just opened quiztest.html (it has simulateLatitude and simulateLongitude) in chrome with GPS off and my "Ar boxes" show. quiz.html , which has not simulatedLat and Lon, does not work.

herrpedro commented 11 months ago

further testing in iOS reveals that if simulateLatitude and simulateLongitude is present all works in all browsers. Same for Android

thank you

herrpedro commented 11 months ago

spent the whole day thinking about this and the presence of "simulate" so I added a a-entity gps-new-entity-place="latitude: 0; longitude:0" position="0 10 0" and it showed above me (because of position 10) in android Chorme (s22ultra) I (or the lib) must be missing something to pass the gps data to the framework

thanks

Platform-Group commented 11 months ago

Have you looked at this bug?. If that doesn't help, try logging and changing bits and pieces in aframe/src/new-location-based/gps-new-camera.js

herrpedro commented 11 months ago

I'v ran the samples with js code from internet and from the samples and always without sucess in android chrome, for example the only way to work in all browsers is with simulated coordinates Thank you for your insight

herrpedro commented 11 months ago

Tried project wizard from AR-js overcome the warning of "don't get gps coordinates before user interaction" but... this just won't work Does anyone have a combination of versions that work for location AR in chrome? I'm using plain js but I can use some other thing if needed

Thank you all

herrpedro commented 10 months ago

@nickw1 hi nick, this is my bug, i just tested the other solution you gave on the other one but then all my comments there would be unrelated and highjacking the other issue

about the links you provided https://github.com/AR-js-org/AR.js/tree/master/aframe/examples/new-location-based/poi works great in firefox and shows nothing in chrome

https://github.com/AR-js-org/AR.js/tree/master/aframe/examples/new-location-based/basic-js removed the alert about gps and i open the page with gps enabled

herrpedro commented 10 months ago

Android chrome is now working as it should and always did I ended up by coding some javascript for debugging and foud out the coordinates of my device were way of and found accuracy was 2km There is a setting in my android phone the makes high accuracy available for each app and it was disabled for chrome and enabled for firefox.

That's why nothing was showing to me WhatsApp Image 2023-08-20 at 19 00 14

Still.. "brave" browser is not working yet but may be it just takes some time... didn't go and check "can i use" things for him

Thank you @Platform-Group and @nickw1 . Hope this thread helps someone.

nickw1 commented 10 months ago

@herrpedro glad you got it working! Thanks for sharing your experiences.