Post

Replies

Boosts

Views

Activity

CMAltimeter becomes somehow uncalibrated: absolute locations not delivered anymore (temporarily)
Note: I have had issues with CMAltimeter since whats seems to have been a major undocumented modification since iOS 17.4. So I'm using the CMAltimeter absolute locations delivery. Sometimes, the altimeter seems to be in an uncalibrated mode and therefore, no altitude delivery happens. Is there a way to be inform of such state? Currently, it just doesn't work and I can't inform the user about this. They just think the app is broken What message should I give to the users to accelerate the calibration such that the CMAltimeter will work again? Also, users have reported that the CMAltimeter can temporarily stop delivering altitude updates, even though it should. So I guess my question resumes to this: Whats the best practice to handle an uncalibrated CMAltimeter? Thanks!
0
0
165
2w
iOS 18.2 crash on CGImageDestinationFinalize
My app reports a lot of crashes from 18.2 users. I have been able to narrow down the issue to this line of code: CGImageDestinationFinalize(imageDestination) The error is Thread 93: EXC_BAD_ACCESS (code=1, address=0x146318000) But I have no idea why this suddently started to crash. Here is the code of the function: private func estimateSizeUsingThumbnailMethod(fromImageURL url: URL, imageSettings: ImageSettings) -> (Int, Int) { let sourceOptions = [kCGImageSourceShouldCache: false] as CFDictionary guard let source = CGImageSourceCreateWithURL(url as CFURL, sourceOptions), let imageProperties = CGImageSourceCopyPropertiesAtIndex(source, 0, nil) as? [CFString: Any], let imageWidth = imageProperties[kCGImagePropertyPixelWidth] as? CGFloat, let imageHeight = imageProperties[kCGImagePropertyPixelHeight] as? CGFloat else { return (0, 0) } let maxImageSize = max(imageWidth, imageHeight) let thumbMaxSize = min(2400, maxImageSize) // Use original size if possible, but not if larger than 2400, in this case we'll extrapolate from thumbnail let downsampleOptions = [ kCGImageSourceCreateThumbnailFromImageAlways: true, kCGImageSourceCreateThumbnailWithTransform: true, kCGImageSourceThumbnailMaxPixelSize: thumbMaxSize as CFNumber, ] as CFDictionary guard let cgImage = CGImageSourceCreateThumbnailAtIndex(source, 0, downsampleOptions) else { DLog("CGImage thumb creation error") return (0, 0) } let data = NSMutableData() guard let imageDestination = CGImageDestinationCreateWithData(data, UTType.jpeg.identifier as CFString, 1, nil) else { DLog("CGImage destination creation error") return (0, 0) } let destinationProperties = [ kCGImageDestinationLossyCompressionQuality: imageSettings.quality.compressionRatio() // Set jpeg compression ratio ] as CFDictionary CGImageDestinationAddImage(imageDestination, cgImage, destinationProperties) CGImageDestinationFinalize(imageDestination) // <----- CRASHES HERE with EXC_BAD_ACCESS ... } So far, I'm stuck. Any idea that could help would be greatly appreciated, as I'm scared that this crash will propagate on the official release of 18.2
1
0
583
Nov ’24
CMAltimeter absolute altitude delivery BROKEN (super slow & inaccurate)
Reproducible on iOS 17.4.1 (maybe before) & iOS 17.5. Maybe iOS 17.4 but I can't test it. NSMotionUsageDescription is correctly set (and has always been) Fitness activity & motion authorization are correctly enabled The delivery for absolute altitude changes became super slow, and might be inaccurate. The only value I get is exactly the same as the GPS altitude. The accelerometer data does not seem to be taken into account anymore. This critical bug has broken two apps of mine. How could I quickly solve this? Thank you! PS: code is dead simple let operationQueue = OperationQueue() self.altimeter.startAbsoluteAltitudeUpdates(to: operationQueue) { [weak self] (data, error) in guard let self = self else { return } guard let data else { return } DispatchQueue.main.async { // Use this value for display self.altitude = Measurement(value: data.altitude, unit: UnitLength.meters) /* DEBUG VIEW */ self.updateDebugView(with: data.altitude) } }
2
0
896
May ’24
One-way file transfer: when to cleanup the source file?
I'm using Watch Connectivity to transfer files from the Watch to its paired iOS device. File transfer is successful in my first tests, but obviously I need to erase the source file when it is - successfully - sent. When should I do that? just after initiating the file transfer, using transferFile(file: NSURL, metadata: [String : AnyObject]) when getting the returned WCSessionFileTransfer? when getting the callback func session(_ session: WCSession, didFinish fileTransfer: WCSessionFileTransfer ? --> but will the callback always be called, even if the transfer finishes while the app is in background? some other time? NB: I'd really want to avoid implementing a custom 'ack' system, thus not using any user info/application context transfer.
1
0
744
Aug ’23
StoreKit2: Transaction.currentEntitlements returns expired subscriptions (Testing locally with shortened sub periods)
Hi, title says it all: I have Transaction.currentEntitlements returning expired subscriptions (testing both transaction expirationDate & RenewalState). Environment: local via .storekit file. Subscription duration is shortened for testing. Could it be the issue? The sub duration is normally 1 year. The documentation says it should only returns active subscription (RenewalState.subscribed) or in grace period (RenewalState.inGracePeriod).
3
2
2.1k
May ’23
iOS 16.4: UISearchTextField.resignFirstResponder() --> app hangs, CPU 100%
Since iOS 16.4, my apps hangs when I dismiss the keyboard in viewWillDisappear(). Here is my code: override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) DLog("will disappear <<<<<") dismissKeyboard() } fileprivate func dismissKeyboard() { self.filenameSearchTextField.resignFirstResponder() } App hangs, CPU is 100%, memory usage is increasing. The hangs happen on the resignFirstResponder() call. What's going on here?
1
0
648
Mar ’23
Re-purchasing an expired auto-renewable subscription
Hi,In the following scenario :User purchases an auto-renewable subscription (ex: 1 month) for a premium accessUser cancels the subscription but still has premium access until it expiresWhen expired, the user purchases the subscription again--&gt; I receive a .restored transaction state in the paymentQueue updated transactions (sandbox environment)I was expecting a .purchased instead.The problem is that in that case, there is no call to paymentQueueRestoreCompletedTransactionsFinished(_: SKPaymentQueue)How should I handle this case properly?Thank you!
1
0
1.4k
Jun ’20