Posts

Post not yet marked as solved
0 Replies
628 Views
I am fetching an image from the photo library and fetch the GPS Location data, but it's not working. This needs to work on iOS 17 as well, so I used PHPicker. kCGImagePropertyGPSDictionary is always returning nil. The code I tried: import CoreLocation import MobileCoreServices import PhotosUI class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate { @IBOutlet weak var selectedImageView:UIImageView! @IBAction func selectTheImage() { self.pickImageFromLibrary_PH() } func pickImageFromLibrary_PH() { var configuration = PHPickerConfiguration(photoLibrary: PHPhotoLibrary.shared()) configuration.filter = .images let picker = PHPickerViewController(configuration: configuration) picker.delegate = self present(picker, animated: true, completion: nil) } func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) { if let itemProvider = results.first?.itemProvider, itemProvider.canLoadObject(ofClass: UIImage.self) { itemProvider.loadObject(ofClass: UIImage.self) { (image, error) in if let image = image as? UIImage { self.fetchLocation(for: image) } } } picker.dismiss(animated: true, completion: nil) } func fetchLocation(for image: UIImage) { let locationManager = CLLocationManager() guard let imageData = image.jpegData(compressionQuality: 1.0) else { print("Unable to fetch image data.") return } guard let source = CGImageSourceCreateWithData(imageData as CFData, nil) else { print("Unable to create image source.") return } guard let properties = CGImageSourceCopyPropertiesAtIndex(source, 0, nil) as? [String: Any] else { print("Unable to fetch image properties.") return } print(properties) if let gpsInfo = properties[kCGImagePropertyGPSDictionary as String] as? [String: Any], let latitude = gpsInfo[kCGImagePropertyGPSLatitude as String] as? CLLocationDegrees, let longitude = gpsInfo[kCGImagePropertyGPSLongitude as String] as? CLLocationDegrees { let location = CLLocation(latitude: latitude, longitude: longitude) print("Image was taken at \(location.coordinate.latitude), \(location.coordinate.longitude)") } else { print("PHPicker- Location information not found in the image.") } } } Properties available in that image: Exif/Meta-Data is available, I expect GPS location data ColorSpace = 65535; PixelXDimension = 4032; PixelYDimension = 3024; }, "DPIWidth": 72, "Depth": 8, "PixelHeight": 3024, "ColorModel": RGB, "DPIHeight": 72, "{TIFF}": { Orientation = 1; ResolutionUnit = 2; XResolution = 72; YResolution = 72; }, "PixelWidth": 4032, "Orientation": 1, "{JFIF}": { DensityUnit = 0; JFIFVersion = ( 1, 0, 1 ); XDensity = 72; YDensity = 72; }] Note: I'm trying in Xcode 15 and iOS 17. In photos app location data is available, but in code, it's returning nil.
Posted Last updated
.
Post not yet marked as solved
1 Replies
747 Views
In our app, we are retrieving the SIM card country code. CTTelephonyNetworkInfo().serviceSubscriberCellularProviders But 'serviceSubscriberCellularProviders' was deprecated in iOS 16.0 with no replacement. So in iOS 17, is there any other way to get a SIM card-based country code?
Posted Last updated
.
Post not yet marked as solved
0 Replies
549 Views
I've implemented Password AutoFill for our webpage. It's working fine in safari browser and SFSafariViewController Safari browser Same way, in our mobile app, we are using a web-based login page. For the login, we are using WKWebView, but in WKWebView the popup is not showing, instead, it’s showing the normal keyboard. WKWebView - App Already configured Associated Domains under Capability. webcredentials:prod.auth.TestDomain.org
Posted Last updated
.
Post marked as solved
1 Replies
1.3k Views
Are we able to create our own watch face to our application. We have ios app and watch app, need to create watch face with few app data's like heart rate, steps count, etc on the watch face. But I fount some answers like it is not possible to create a watch face. Possible to create watch face for Apple Watch? Are developers allowed to publish watch faces? I have found a website Facer(https://www.facer.io/creator) where they are offering customizing options and generating .watchface from their website. What approach they are following?
Posted Last updated
.
Post not yet marked as solved
0 Replies
675 Views
I'm using SFSafariViewController for load weblinks, In my case first I need to open one URL after some process/time(like 10 sec) I need to update my URL in the same tab and refresh SFSafariViewController. if let url = URL(string: "Google.com") { let VC= SFSafariViewController(url: url) VC.delegate = self self.present(VC, animated: true, completion: nil) } There is any way to update The URL and refresh the current SFSafariViewController page?
Posted Last updated
.
Post not yet marked as solved
2 Replies
628 Views
I'm Trying to create new App in appstoreconnect,But I'm getting Below Error"You have no eligible Bundle IDs for iOS apps."https://i.stack.imgur.com/vGNal.pngBut I have already register Identifiers in developer.apple.com.https://i.stack.imgur.com/px9gJ.pngNote : https://stackoverflow.com/questions/59598466/you-have-no-eligible-bundle-ids-for-ios-apps-register-one-here
Posted Last updated
.