cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

getCurrentLocation doesn't work on mobile - Need location permissions for View App

Regular Member

getCurrentLocation doesn't work on mobile - Need location permissions for View App

We are trying to create some method for which to track the location from which a user access our Vuforia Experience Service to try and reduce unauthorized access. I found in the $scope.device.location a function called getCurrentLocation(), which when called updates the $scope.device.location.lastLocation values. Testing on the preview it works exactly as expected, however on mobile it does not. I suspect this is because I was able to allow location on my browser however, since the View App does not have a request to allow access to location built into it a mobile does not produce a location and there is no where to force it in the phones permissions settings because again the View app does not have the provisions for it by default.

 

I'm wondering if there is a way to trigger this permission request from the experience itself (both on iOS and Android) or some other method for which to get the GPS Lat and Long (perhaps even just IP address) of the device which a user is accessing with?

 

Thanks for your time.

1 REPLY 1

Re: getCurrentLocation doesn't work on mobile - Need location permissions for View App

Hi @ttambur ,

 

In chrome in generally     will works but for mobiles devices (Android and iOS) you should have different permission api which you can use in web platform. An  Android and iOS mobiles app (Vufori view) need to  ask for additional permission which could be done by API. This is, so far I know not implemented so that you cannot request additional permission like ,microphone location and etc.   and that is why you don't see this permission in Settings.

One possible way I know is to track the location for the mobile device  in thingworx thing property or getting it via service in customized string and to display this in the external data section in the Vuforia studio

In the community there are some posts about live data tracking:

1.)Live Mobile location tracking

https://community.ptc.com/t5/ThingWorx-Developers/Live-Mobile-location-tracking/m-p/550587#M28740

 

2.)Live Mobile location tracking

https://community.ptc.com/t5/ThingWorx-Developers/Live-Mobile-location-tracking/m-p/550686#M28769

Announcements
Topics available:
AR/VR for Data Optimization AR/VR for Security and Control AR/VR for Inspection