[MAYBE RESOLVED] "/private/var/mobile/Containers/Bundle/Application/" Would Like To Use Your Current Location

Hi there,
I know this problem was already asked BUT no-one fight to defeat it so… here I am :smile:
When the app is retrieving the location of the user on an iOS device, a popup is shown:

"/private/var/mobile/Containers/Bundle/Application/" Would Like To Use Your Current Location

Now. There are lots of people suggesting for a solution but no-one works as expected.
The possible solution can be in:

  • Change the message? (don’t think is possible because of an iOS safari tool)
  • Change the library used for get the coords? (navigation and $cordovaGeolocation throw the same popup)
  • Add some listener to it?
  • Anything else?

Let me help myself and all the community to get the REAL solution to it :blush:

Here the PopUp that is shown

Let’s win!

3 Likes

Use navigator.geolocation.getCurrentPosition(…) for the first time, you will get a proper message. :smile:

No way, I’ve tried that before write here :expressionless:

navigator.geolocation.getCurrentPosition(function(pos) {
			glat = pos.coords.latitude;
			glon = pos.coords.longitude;
	},function(err){
		console.log(err);
	});

If I remove it the popup is not shown, so…

Do you have [NSLocation…] key in your plist ?

Nope I don’t have it. I didn’t touch that file

Check your .plist file, if it doesn’t have a [NSLocationWhenInUseUsageDescription] key then add it. May be this could help you.

Wait! I had <key>NSLocationWhenInUseUsageDescription</key> <string>App Using Location</string>
BUT when I’ve removed it the popup was not shown… I’ll let you know in minutes! :blush:

EDIT:
NO! The message is still there… :’(

Give a try to navigator.geolocation.watchPosition(…) instead of getCurrentPosition…

Tested. Same :expressionless:
(btw thanks for your time :smile:)

Ok I’ve tried like EVERYTHING!
That popup is always there and I can’t get how to make it disappear.
Any new advise guys? :blush:

I found that on iOS my app (http://www.pokerdiy.com/pokerdiy-game-finder-mobile-app) this message shows sometimes but sometimes it shows the native screen… I have not worked out when/why but I think it is something to do with timing and which events are firing first… on Android it is fine

Wait… I’ve removed the cordova geolocation plugin and that popup is still there???
Looking into that…

GREAT! It takes a lot but I’ve found (until now) THE fix for this problem.

$ionicPlatform.ready(function() {
   //Check the position with $cordovaGeolocation. This one is just a function
   checkPosition()
});

That’s all.
The popup seems to be shown when you check the location MEANWHILE the app is loading.
This trick will check the location JUST WHEN THE APP IS REALLY READY and the popup is not shown!
I’ll update this thread if something will change :smile:

4 Likes

How did you solved it man, I cant get to solve it, My android app is published and the iOS one just dont…
I need help really bad and I’ve done everything you did + a like 25 other solutions.

Hi @cicerohellmann.
I’ve read somewhere to never use watchPosition, use getCurrentPosition instead. Ionic1 of course.
I’ve fixed in the most easy way :slight_smile:

My app keep gettin the weird popup. He Asks the first time with the correct geolocation permission and then, after that he askes again with the wirkd /adasfdasf/asfas/fasf/afasf/ path… I can’t get to solve it. I just can’t believe I’m the only one having this kind of trouble and that this problem haven’t been addressed more aggressively yet…

It took several weeks to me to fix this problem… I’m trying to use Ionic2 ATM but there are so many changes every week that even the documentations around the web are not updated. Maybe with the v2 some stuff will be fixed. Maybe.

I fixed,
In your Index:

   <body ng-app="app" class="platform-ios platform-cordova platform-webview">
      <ion-nav-view></ion-nav-view>
   </body>

And if you are using the geolocation plugin, keep in mind that in the JS file he has it´s own pre programed message.

REMOVE IT AND WRITE YOUR OWN

But srsly, thank you, I don´t see how you think it would help me to say that you solved and don´t say what you did to do it.

It was srsly hard to solve it and I hope some people who stumble across this problem to find my solution suitable. And if you need any more help from me, feel free to ask, I will respond directly to the point.

Thx @portapipe for the solution. I used to load the location too when the platform wasn’t ready and faced that message. Now that I moved the detection of the current location when my platform is ready I didn’t see the msg anymore, great!

Glad to hear that :thumbsup: