Skip to content

Custom location on iOS Emulator fails without updating the Info.plist file #210

@FireJuun

Description

@FireJuun

In testing with the example app on an iOS simulator with a custom location, I am unable to consistently get the app to initialize its user location. Using this with one of the default locations in Simulator is working as intended, however.

I think I have a fix for this as well, but I'm curious if others are able to recreate this issue.

Environment details

  1. Flutter version 3.24.3, stable channel
  2. macOS 14.6.1 23G93 darwin-arm64, locale en-US
  3. google_navigation_flutter: ^0.3.0

Steps to reproduce

  1. Add a .env/development.env file with MAPS_API_KEY=[[YOUR_API_KEY]]
Default Location (Working)
  1. On Apple Simulator, go to Features -> Location -> Apple
  2. Run example app using --dart-define-from-file .env/development.env
  3. This works as intended, showing the correct location (in this case, Apple's headquarters).
Custom Location -- FAILING
  1. On Apple Simulator, go to Features -> Location -> Custom Location and input latitude -33.852, longitude 151.211 (using this example).
  2. Run example app using --dart-define-from-file .env/development.env
  3. The app will attempt to load user location, but fails and defaults to MIT.
  4. You cannot add any waypoints or start navigation.
Custom Location -- FIX
  1. Add the following lines to your Info.plist file

info.plist

	...
	<key>NSAppTransportSecurity</key> <dict>
	<key>NSAllowsArbitraryLoads</key><true/> </dict>
	...
  1. Run the app with the same settings as Failing Test.
  2. The app will now load Sydney as originally intended.

Metadata

Metadata

Labels

priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions