Hi guys!
I am trying to extract Location Services data from an iPhone running developer mode, and have installed the "Location Services for iOS" Profile that can be found on the Profiles and Logs page. I have also read the Instructions PDF, and done the setup.
I am having a hard time finding the actual logs after exporting the sysdiagnose folder. The folder is quite big and complex.
Can someone please help me, and tell me where I can find it?
Thanks!
Maps & Location
RSS for tagLearn how to integrate MapKit and Core Location to unlock the power of location-based features in your app.
Post
Replies
Boosts
Views
Activity
I have a LookAroundPrewiew in a frame which itself is already small. On top of that is the LookAroundPreview automatically appended onto the preview. In fact it doesn’t really bother me per se, but it’s that my view doesn’t have much space. So is it possible customize the view by removing the text ? And the Apple Maps text at the bottom of the image which is fairly small isn’t a problem for me.
I need to hide or remove gps indicator from status bar/ navigation bar on background mode. I have already used locationManager?.showsBackgroundLocationIndicator = false but it doesn't when user select "While using the app".
The beacon device is very close to the phone(ios17).
But the RSSI obtained from the beacon information returned by the locationManager's didRange function is always 0. Why?
log:
didRange [CLBeacon (uuid:D4C3CCC0-29FB-11E5-884F-0002A5D5C51B, major:0, minor:9, proximity:0 +/- -1.00m, rssi:0, timestamp:2024-02-15 06:48:57 +0000)]
didRange [CLBeacon (uuid:D4C3CCC0-29FB-11E5-884F-0002A5D5C51B, major:0, minor:9, proximity:0 +/- -1.00m, rssi:0, timestamp:2024-02-15 06:48:58 +0000)]
didRange [CLBeacon (uuid:D4C3CCC0-29FB-11E5-884F-0002A5D5C51B, major:0, minor:9, proximity:0 +/- -1.00m, rssi:0, timestamp:2024-02-15 06:48:59 +0000)]
didRange [CLBeacon (uuid:D4C3CCC0-29FB-11E5-884F-0002A5D5C51B, major:0, minor:9, proximity:0 +/- -1.00m, rssi:0, timestamp:2024-02-15 06:49:00 +0000)]
I have tried to make colored annotations in mapView (shown in the commented sections) but they always appear in black. Any help would be appreciated.
func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
let annotationView = MKAnnotationView(annotation: annotation, reuseIdentifier: "TempAnnotationView")
annotationView.canShowCallout = true
annotationView.rightCalloutAccessoryView = UIButton(type: .detailDisclosure)
let configuration = UIImage.SymbolConfiguration(pointSize: 10, weight: .thin, scale: .default)
if annotation.title == "Start" {
// let config = UIImage.SymbolConfiguration.preferringMulticolor()
// let image = UIImage(systemName: "flag.fill", withConfiguration: config)
// // palette
// let config2 = UIImage.SymbolConfiguration(paletteColors: [.systemRed, .systemGreen, .systemBlue])
// let image2 = UIImage(systemName: "person.3.sequence.fill", withConfiguration: config2)
// // hierarchical symbols
// let config3 = UIImage.SymbolConfiguration(hierarchicalColor: .systemIndigo)
// let image3 = UIImage(systemName: "square.stack.3d.down.right.fill", withConfiguration: config3)
// // color
// let image4 = UIImage(systemName: "cone.fill")?.withTintColor(.systemRed, renderingMode: .alwaysTemplate)
// annotationView.image = image4
annotationView.image = UIImage(systemName: "poweron", withConfiguration: configuration)
}
return annotationView
}
how to add an offline map (longitude and latitude) please help
I understand that MapKit automatically sizes the font based on the system Dynamic Type size.
The thing is, the default font size is plenty legible for me system wide except for some type in MapKit, while other type in MapKit is already plenty big.
For instance, the stream names are much harder to read than they should be by default. And if I increase the system Dynamic Type size, then it makes some MapKit text much larger than needed, while the stream text can still be hard to read.
So is there anyway to override or adjust font sizes in MapKit? I'd like to be able to apply percentages to Dynamic Type suggestions. Like for streams, I'd like to scale it somewhere between 133% and 150%.
The smallest Dynamic Type is size is .caption2 at 11 points with default settings. With default Dynamic Type settings, it looks like MapKit is drawing stream text around 7 points.
I'm developing a map-based app for visionOS. The loads map data from a server, using JSON. It works just fine, but I noticed the following effect: If I move the app's window around, it freezes; either on the first movement, or on one of the subsequent ones. The map cannot be panned anymore, and all other UI elements lose their interactivity as well.
I noticed this issue before, when I was opening the map on app startup (and here it even happened without moving the window). Since I added a short delay, this was resolved. There was no log message in this case.
However, when I noticed that it also happens if I move the window around, I saw that Xcode logs an error:
+[UIView setAnimationsEnabled:] being called from a background thread. Performing any operation from a background thread on UIView or a subclass is not supported and may result in unexpected and insidious behavior. trace=(
0 UIKitCore 0x0000000185824a24 __42+[UIView(Animation) setAnimationsEnabled:]_block_invoke + 112
1 libdispatch.dylib 0x0000000102a327e4 _dispatch_client_callout + 16
2 libdispatch.dylib 0x0000000102a34284 _dispatch_once_callout + 84
3 UIKitCore 0x0000000185824ad8 +[UIView(Animation) performWithoutAnimation:] + 56
4 SwiftUI 0x00000001c68cf1e0 OUTLINED_FUNCTION_136 + 10376
5 SwiftUI 0x00000001c782bebc OUTLINED_FUNCTION_12 + 22864
6 SwiftUI 0x00000001c78285e8 OUTLINED_FUNCTION_12 + 8316
7 SwiftUI 0x00000001c787c288 OUTLINED_FUNCTION_20 + 39264
8 SwiftUI 0x00000001c787c2cc OUTLINED_FUNCTION_20 + 39332
9 UIKitCore 0x000000018582fc24 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1496
10 QuartzCore 0x000000018a05cf00 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 440
11 QuartzCore 0x000000018a068ad0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 124
12 QuartzCore 0x0000000189f80498 _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 460
13 QuartzCore 0x0000000189fb00b0 _ZN2CA11Transaction6commitEv + 652
14 VectorKit 0x00000001938ee620 _ZN2md12HoverSupport18updateHoverProxiesERKNSt3__16vectorINS1_10shared_ptrINS_5LabelEEEN3geo12StdAllocatorIS5_N3mdm9AllocatorEEEEE + 2468
15 VectorKit 0x0000000193afd1cc _ZN2md15StandardLabeler16layoutForDisplayERKNS_13LayoutContextE + 156
16 VectorKit 0x0000000193cf133c _ZN2md16CompositeLabeler16layoutForDisplayERKNS_13LayoutContextE + 52
17 VectorKit 0x0000000193abf318 _ZN2md12LabelManager6layoutERKNS_13LayoutContextEPKNS_20CartographicRendererERKNSt3__113unordered_setINS7_10shared_ptrINS_12LabelMapTileEEENS7_4hashISB_EENS7_8equal_toISB_EEN3geo12StdAllocatorISB_N3mdm9AllocatorEEEEERNS_8PassListE + 2904
18 VectorKit 0x0000000193cad464 _ZN2md9realistic16LabelRenderLayer6layoutERKNS_13LayoutContextE + 464
19 VectorKit 0x0000000193658b54 _ZNSt3__110__function6__funcIZN2md9realistic20RealisticRenderLayer5frameERNS2_13LayoutContextEE3$_0NS_9allocatorIS7_EEFvvEEclEv + 180
20 VectorKit 0x00000001936584cc ___ZN3geo9TaskQueue14queueAsyncTaskENSt3__110shared_ptrINS_4TaskEEEPU28objcproto17OS_dispatch_group8NSObject_block_invoke + 80
21 libdispatch.dylib 0x0000000102a30f98 _dispatch_call_block_and_release + 24
22 libdispatch.dylib 0x0000000102a327e4 _dispatch_client_callout + 16
23 libdispatch.dylib 0x0000000102a3aa80 _dispatch_lane_serial_drain + 916
24 libdispatch.dylib 0x0000000102a3b7c4 _dispatch_lane_invoke + 420
25 libdispatch.dylib 0x0000000102a3c794 _dispatch_workloop_invoke + 864
26 libdispatch.dylib 0x0000000102a481a0 _dispatch_root_queue_drain_deferred_wlh + 324
27 libdispatch.dylib 0x0000000102a475fc _dispatch_workloop_worker_thread + 488
28 libsystem_pthread.dylib 0x0000000103b0f924 _pthread_wqthread + 284
29 libsystem_pthread.dylib 0x0000000103b0e6e4 start_wqthread + 8
I disabled all my withAnimation() statements, and the problem persists. I also thought it might be related to my own network fetches, but I think all apply their changes on the main thread. And when I turn on network logging for my own fetching logic, I do not see any data coming in. I also do not think there should be a reason for it.
How can I debug such a situation, so I know, which call actually threw this message? I'd like to know if it is my code or a bug in the SwiftUI map itself.
Hi Developers. I need to try to embed GeoData into a USDZ model and then have the capabilities to "explore" the model while walking around in the real world.
e.g. load and display a 3D model of Time Square and show a location pin which displays a users' virtual position on the model... when the user walks 10 meters north, in the real world, the location pin must move 10m (to scale) on the displayed model.
As a new developer, I'm starting from scratch so would benefit greatly from having my hand held - please don't be afraid of patronizing me.
Step 1 - load and display the 3D model
Step 2 - geolocate the user
Step 3 - translate the user's current position into a position on the 3D model and represent their "position" on the model with a traditional GPS location marker "pin".
Step 4 - move the user's GPS pin on the mode, relative to (and reflecting) their actual real world movement.
Is this acheivable or have I explained things to ambiguously?
I look forward to hearing from my savior(s) as soon as convenient.
Thank you in advance
CLMonitor WWDC video, it says the same name can be reused await CLMonitor("greeting") but the production iOS 17 API actually crashes. Is this the correct behaviour? (See screenshot 1)
for try await events in monitor.events should work in from the WWDC video, but the production iOS 17 API does not work and need to insert await after in keyword. Also, never received any events from the monitor (See screenshot 2)
WWDC Video: https://developer.apple.com/wwdc23/10147
Hi, I am learning about MapKit for SwiftUI, at first I created the MKMapItem
@State private var mapSelection: MKMapItem?
@State var starbucksReserve = MKMapItem(placemark: .init(coordinate: CLLocationCoordinate2D(latitude: 41.894178596474575, longitude: -87.62451598445733)))`
I put that in the Map
Map(position: $cameraPosition,selection: $mapSelection){
Marker("Starbucks Reserve", systemImage: "cup.and.saucer.fill" ,coordinate: starbucksReserve.placemark.coordinate)
}
Even though I have put the selection $mapSelection, my Marker is not selectable. I am not sure why. I tried to fix it by changing mapSelection to Int? and made a tag for Marker, but because I am learning how to use it so I want to make sure why marker cannot be selectable with the first approach?
Thank you
I found something when I use CLLocationManagerDelegate on VisionOS.
When I called func locationManagerDidChangeAuthorization
func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) {
switch manager.authorizationStatus {
case .notDetermined, .denied:
locationManager.requestWhenInUseAuthorization()
default:
locationManager.startUpdatingLocation()
guard let center = locationManager.location?.coordinate else { return }
isFollowing = false
mapCamera = .region(.init(center: center, span: .init(latitudeDelta: 0.005, longitudeDelta: 0.005)))
addItems()
}
}
Although I choose allow auth, locationManagerDidChangeAuthorization wasn't called.
I am creating a mobile app based around city tours. I want to include a "download" function that would allow the user to tour offline using GPS/Apple maps. Is this possible?
Hi All,
I need user continues location event if app in background and terminated (Not-running) mode
below is the code I'm using to get the location but still I'm not get the location continuously
import BackgroundTasks
import UIKit
class AppDelegate: UIResponder, UIApplicationDelegate {
var significatLocationManager: CLLocationManager?
func startSignificationLocation() {
self.significatLocationManager = CLLocationManager()
self.significatLocationManager?.delegate = self
self.significatLocationManager?.activityType = .fitness
self.significatLocationManager?.distanceFilter = 10
self.significatLocationManager?.desiredAccuracy = kCLLocationAccuracyNearestTenMeters
self.significatLocationManager?.allowsBackgroundLocationUpdates = true
self.significatLocationManager?.pausesLocationUpdatesAutomatically = false
self.significatLocationManager?.startUpdatingLocation()
self.significatLocationManager?.startMonitoringSignificantLocationChanges()
self.significatLocationManager?.requestAlwaysAuthorization()
}
func stopAllRegionMonitoring(locationManager:CLLocationManager?){
for delRegion in (locationManager?.monitoredRegions ?? []){locationManager?.stopMonitoring(for: delRegion)}
}
}
extension AppDelegate: CLLocationManagerDelegate {
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
self.myLocation = locations.last
//call update My Location API
if (self.myLocation?.horizontalAccuracy ?? 0.0) <= (self.liveLocationTrackingRegionRadius + 15.0 ){
self.createRegion(location: self.myLocation)
} else {
manager.stopUpdatingLocation()
manager.startUpdatingLocation()
}
}
func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) {}
func locationManagerDidPauseLocationUpdates(_ manager: CLLocationManager) {
manager.startUpdatingLocation()
}
func locationManagerDidResumeLocationUpdates(_ manager: CLLocationManager) {
manager.startUpdatingLocation()
}
}
extension AppDelegate {
func createRegion(location:CLLocation?, type:LocationRegionMonitoringTyep = .LiveLocationTracking) {
if self.significatLocationManager == nil {
self.startSignificationLocation()
}
guard let location = location else { return }
guard CLLocationManager.isMonitoringAvailable(for: CLCircularRegion.self) else{ return }
var identifier:String = "Live_Location_Tracking-" + "\(location.coordinate.latitude)" + "-" + "\(location.coordinate.longitude)"
if (self.significatLocationManager?.monitoredRegions.count ?? 0) > 10 {
self.stopAllRegionMonitoring(locationManager: self.significatLocationManager)
}
var region : CLCircularRegion?
region = CLCircularRegion(center: CLLocationCoordinate2D(latitude: location.coordinate.latitude,longitude: location.coordinate.longitude),radius: 10.0 ,identifier: identifier)
region?.notifyOnExit = true
self.significatLocationManager?.startUpdatingLocation()
if let reg = region {
self.significatLocationManager?.startMonitoring(for: reg)
}
}
func stopAllRegionMonitoring(locationManager:CLLocationManager?){
let WOMRequestId:String? = UserDefaultManager.shared.womEmergencyDetails?.data?.request?.id
for delRegion in (locationManager?.monitoredRegions ?? []){
if let reqId = WOMRequestId {
if delRegion.identifier.contains(reqId) {
locationManager?.stopMonitoring(for: delRegion)
}
} else {
locationManager?.stopMonitoring(for: delRegion)
}
}
}
func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) {
if region.identifier.contains(AppConstants.WatchOverMe) {
AppDelegate.shared?.isWOMReachDestination(location: manager.location, region: region)
} }
func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) {
self.myLocation = manager.location
manager.stopMonitoring(for: region)
self.significatLocationManager?.stopMonitoring(for: region)
manager.startUpdatingLocation()
self.significatLocationManager?.startUpdatingLocation()
self.createRegion(location: self.myLocation)
//update M yLocation API
if region.identifier.contains( AppConstants.WatchOverMe ) {
TabBarController.isWOMReachDestinationAlertShown = false
}
}
func locationManager(_ manager: CLLocationManager, monitoringDidFailFor region: CLRegion?, withError error: Error) {
self.myLocation = manager.location
self.createRegion(location: self.myLocation)
}
}
extension AppDelegate {
func applicationDidEnterBackground(_ application: UIApplication) {
self.scheduleBackgroundTask()
}
func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
completionHandler(.newData)
}
func registerBGTask(){
BGTaskScheduler.shared.register(forTaskWithIdentifier: self.getBGTaskIdentifier(), using: nil) { task in
self.handleBackgroundTask(task: task as! BGAppRefreshTask)
}
}
func handleBackgroundTask(task: BGAppRefreshTask) {
task.setTaskCompleted(success: true)
}
func scheduleBackgroundTask() {
let request = BGAppRefreshTaskRequest(identifier: self.getBGTaskIdentifier() )
request.earliestBeginDate = Date(timeIntervalSinceNow: 10) // 30 second
do {
try BGTaskScheduler.shared.submit(request)
} catch {
print("Unable to schedule background task: (error)")
}
}
func getBGTaskIdentifier()->String {
let bundleId:String = AppInfoManager.shared.bundleId + ".locationBackgroundTask"
return bundleId
}
func startLocationTrackingTimer() {
self.stopLocationTrackingTimer()
self.locationTrackingTimer = Timer.scheduledTimer(timeInterval: 1.0,target: self,
selector: #selector(self.updateUserLocation),userInfo: nil,repeats: true)
RunLoop.current.add(self.locationTrackingTimer!, forMode: .common)
}
func stopLocationTrackingTimer() {
self.locationTrackingTimer?.invalidate()
self.locationTrackingTimer = nil
}
@objc func updateUserLocation() {
if self.isSocketActive {
self.updateMyLocationAPI(fromRoam: false)
} else {
self.updateUserCurrentLocation()
}
}
}
This post states that attribution is required for MapKit or violates the developer agreement.
Can I provide my own attribution if I am displaying my original map content? It seems bizarre to attribute map sources that are not used.
I need multiple MKTileOverlays with multiple blendModes. Apparently using an overlay with a different blend causes the layer under to use the same blend mode.
For the example below, using a normal blend mode on top of a soft light blend mode causes a normal blend mode to be used instead of soft light. The soft light layer is rendered as expected until the normal layer is displayed starting at zoom level 15.
First, I've subclassed MKTileOverlay to add an overlay type so that the correct renderer is provided per overlay. (I know there is a title, but I prefer this)
enum OverlayType {
case softLight,
normal
}
class TileOverlay: MKTileOverlay {
var type: OverlayType = .normal
}
Then setup layers and renderers in the typical fashion:
var softLightRenderer: MKTileOverlayRenderer!
var normalRenderer: MKTileOverlayRenderer!
private func setupSoftlightRenderer() {
let overlay = TileOverlay(urlTemplate: "http://localhost/softlight/{z}/{x}/{y}")
overlay.type = .softLight
overlay.canReplaceMapContent = false
overlay.minimumZ = 9
overlay.maximumZ = 20
mapView.addOverlay(overlay, level: .aboveLabels)
softLightRenderer = MKTileOverlayRenderer(tileOverlay: overlay)
tileRenderer.blendMode = .softLight
}
private func setupNormalRenderer() {
let overlay = TileOverlay(urlTemplate: "http://localhost/normal/{z}/{x}/{y}")
overlay.type = .normal
overlay.canReplaceMapContent = false
overlay.minimumZ = 15
overlay.maximumZ = 20
mapView.addOverlay(overlay, level: .aboveLabels)
normalRenderer = MKTileOverlayRenderer(tileOverlay: overlay)
normalRenderer.blendMode = .normal
}
func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer {
if let overlay = overlay as? TileOverlay {
switch overlay.type {
case .softLight:
return softLightRenderer
case .normal:
return normalRenderer
}
}
print("Warning: using unhandled overlay renderer")
return blankRenderer
}
override func viewDidLoad() {
...
setupSoftlightRenderer()
setupNormalRenderer()
}
Interestingly, if I put the overlays at two different levels, one .aboveLabels and another .aboveRoads it works as expected. The problem is that limits me to two different overlay blend modes. I really could use more than two. I tried every possible variation of inserting the layers at different indexes and methods, but the only two that seem to work are the .aboveLabels and .aboveRoads.
How can I use more than two different blend modes?
In m1 MACs run
sudo arch -x86_64 pod install --allow-root
to resolve this issue.
Hi, I'm a college student in Hangzhou, China. I want to learn and develop with Find My Network and other useful Apple's tech. But when I access the application website, I can't find the university entrance but only with company.
Can I develop as a college student? Where can I be? Or in the same page, what's the DUNS numbers?
If only corps can, what's the fee to get the DUNS numbers with Apple's support? What's the fee to join in Apple Developments? Should I offer some documents such as Bank Corporate Account Statement? If I create a new corp to join in the development, what should I or corp need and do?
I just wanna develop a school ID card with UWB tech and Apple's useful Find My Network. Hope to get your's help.
Have a good day. Thanks!
I am working on a virtual simulator for iOS 17 from my macbook.
I want to have the initial view present the Map but zoomed out enough so that it's basically showing the whole world - in a 3d render.
My understanding is that as of iOS17 if you have .standard for the MKMapView type, it should still render as 3D if the altitude is high enough. But on my simulator, I literally cannot zoom out any further.
Is the right protocol to update the mapType to be .hybridFlyover? That seems different than the .standard (which I think is what I actually want).
Does anyone have any idea / is there anything sticking out in this code?
Here is my code:
struct GlobeView: UIViewRepresentable {
var coordinates: [IdentifiableCoordinate]
func makeUIView(context: Context) -> MKMapView {
let mapView = MKMapView()
mapView.mapType = .hybridFlyover
mapView.delegate = context.coordinator
let camera = MKMapCamera(lookingAtCenter: CLLocationCoordinate2D(latitude: 0, longitude: 0), fromDistance: 1_000_000_000, pitch: 0, heading: 0)
mapView.setCamera(camera, animated: true)
return mapView
}
func updateUIView(_ uiView: MKMapView, context: Context) {
let annotations = coordinates.map { coordinate -> MKPointAnnotation in
let annotation = MKPointAnnotation()
annotation.coordinate = coordinate.coordinate
return annotation
}
uiView.addAnnotations(annotations)
}
class Coordinator: NSObject, MKMapViewDelegate {
var parent: GlobeView
init(_ parent: GlobeView) {
self.parent = parent
}
}
func makeCoordinator() -> Coordinator {
Coordinator(self)
}
}
@MainActor
perform() async throws -> some IntentResult {
// ...
switch locationManager.authorizationStatus {
case .denied, .restricted:
throw UserLocationError.permissionDenied
case .notDetermined:
await locationManager.requestWhenInUseAuthorization() // to ask permission
default:
break
}
// ...
}
Here is my code.
When the authorizationStatus is .notDetermined,
it invokes requestWhenInUseAuthorization() method on the main thread,
but throws UserLocationError.permissionDenied immediately, eventhough I didn't deny the permission.
It's really weird and unexpected that it throws UserLocationError.permissionDenied when the status is not .denied or .restricted
Even it invokes requestWhenInUseAuthorization(), there's no alert for asking permission
If there's any solution, please let me know