Posts

Post not yet marked as solved
0 Replies
440 Views
Anyone else having issues with Mac Catalyst app submissions? My validation is failing with an error about an iOS provisioning profile not being valid for the app; my iOS version of this app has been uploaded successfully and was distributed via TestFlight already. Even an empty/blank project with Catalyst checked does not work. This is with Xcode 12.2 RC, with an upgrade to Big Sur 11.0.1. Steps: Create new project Rename bundle identifier to match listing in App Store Connect Enable the catalyst checkbox in the iOS target settings Add app icons to satisfy upload Specify app category to satisfy upload Specify app bundle name to satisfy upload Archive with “My Mac” or “Any Mac” selected Attempt to validate this archive and expect success In the organizer log I get the following error message when attempting the above: "App Store Connect Operation Error Unable to process application at this time due to the following error: Invalid Provisioning Profile. This provisioning profile is not compatible with iOS apps.." This app is intended to be a universal bundle identifier and it is set to the identifier that I have successfully uploaded builds to App Store Connect for iOS and released to Test Flight. I checked the configuration of the XC automatic identifier on the developer account page and everything looked fine there. I created Feedback FB8894428 for this.
Posted
by edorphy.
Last updated
.
Post not yet marked as solved
1 Replies
591 Views
I'm unable to find any documentation on how to use atos given the content within an MXCrashDiagnostic's json representation but I think I have worked through most of it. From this documentation here - https://developer.apple.com/documentation/xcode/diagnosing_issues_using_crash_reports_and_device_logs/adding_identifiable_symbol_names_to_a_crash_report I have identified that this is the atos command I'm looking for. % atos -arch <BinaryArchitecture> -o <PathToDSYMFile>/Contents/Resources/DWARF/<BinaryName> -l <LoadAddress> <AddressesToSymbolicate> Using the following from my app AppNameHere this is what I extracted: platformArchitecture (arm64e) from the diagnostic's metadata Load Address (offset) 0x4332388352 Address 0x4332421432 UUID ACF5E4F6-EDD8-36C3-A650-58C53D4D66A7 [ &#9;{ &#9;&#9;"binaryUUID": "432C7D54-5315-3EC7-A3BE-A48E873736A7", &#9;&#9;"offsetIntoBinaryTextSegment": 6762471424, &#9;&#9;"sampleCount": 1, &#9;&#9;"subFrames": [ &#9;&#9;&#9;{ &#9;&#9;&#9;&#9;"binaryUUID": "ACF5E4F6-EDD8-36C3-A650-58C53D4D66A7", &#9;&#9;&#9;&#9;"offsetIntoBinaryTextSegment": 4332388352, &#9;&#9;&#9;&#9;"sampleCount": 1, &#9;&#9;&#9;&#9;"subFrames": [ &#9;&#9;&#9;&#9;&#9;{ &#9;&#9;&#9;&#9;&#9;&#9;"binaryUUID": "9B2D02A4-C9C0-3CAF-BBD2-C1BCEE117E8E", &#9;&#9;&#9;&#9;&#9;&#9;"offsetIntoBinaryTextSegment": 6727446528, &#9;&#9;&#9;&#9;&#9;&#9;"sampleCount": 1, &#9;&#9;&#9;&#9;&#9;&#9;"binaryName": "libdyld.dylib", &#9;&#9;&#9;&#9;&#9;&#9;"address": 6727450176 &#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;], &#9;&#9;&#9;&#9;"binaryName": "AppNameHere", &#9;&#9;&#9;&#9;"address": 4332421432 &#9;&#9;&#9;} &#9;&#9;], &#9;&#9;"binaryName": "UIKitCore", &#9;&#9;"address": 6774548544 &#9;} ] I did not have a .dSYM file with this UUID, but after I went to Xcode Organizer and downloaded bitcode generated symbols I had a .dSYM that matched this UUID. So finally this is the command I created: atos -arch arm64 -o acf5e4f6-edd8-36c3-a650-58c53d4d66a7.dSYM/Contents/Resources/DWARF/AppNameHere -l 0x4332388352 0x0000004332909892 Trial by fire, the numbers in the dump are decimal, you need to convert them to hex. The documentation doesn't specify the format of the 'address' of 'offset'. edorphy$ atos -arch arm64 -o acf5e4f6-edd8-36c3-a650-58c53d4d66a7.dSYM/Contents/Resources/DWARF/AppNameHere -l 1023B0000 10242F544 atos[84639]: respawning is disabled (because DYLD_ROOT_PATH or DT_NO_RESPAWN is set), but the analysis process does not match the SDK variant of the target process 0. Analysis of malloc zones may fail. AppDelegate.initializeApplication(application:) (in AppNameHere) (UserAgreementManager.swift:37) Does anyone know how to get rid of the respawning message, or is that expected? I noticed that the arch is arm64e in the report, but the dwarfdump of the .dSYM says just arm64. It seemed to make no difference specifying with the 'e' or not.
Posted
by edorphy.
Last updated
.
Post not yet marked as solved
0 Replies
455 Views
I have an app that uses an App Group to share data (images) between my main app target and my widget extension. I could load my widget image reliably prior to iOS 14.1 but things seem to not be working lately. The following is my helper to get a reference to the container in both my app and widget target, my static string matches the group in both entitlement files: let directory = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: .widgetGroupIdentifier)! Has anyone else had issues lately using AppGroups and widgets to share data from app to widget? My procedure is as such: Generate Image Save to container directory Reload widget timeline Separately in Widget Extension with debugger attached, wait for getTimeline to fire Read contents of directory, the file is not listed there!
Posted
by edorphy.
Last updated
.
Post marked as solved
1 Replies
514 Views
I upgraded my gear to the public releases for Xcode 12.1 and iOS 14.1 this week. After the upgrades, now whenever I select my iPhone Xs as my run target destination and run ANY project, it takes over a minute to launch my app and attach the debugger to it. I use OSLog directly in didFinishLaunching as my benchmark for launch time as well as the time graph when viewing the energy tab. The behavior is that springboard will launch to my launch storyboard, but then sit there waiting for over a minute before my console statements finally start going, the screen renders to my first view, and the debugger attaches. The strange part is that I can see the energy diagnostics attaching to the phone and it is around the 1:20 mark that things connect and the app finally runs. Also of note, I saw the phone transition to the "serious" thermal state while playing this waiting game a few times in a row so something appears to be thinking real hard. This does NOT happen on my iPad Pro running 14.1, nor my iPhone SE 2020 running 14.0--seems isolated to my Xs with 14.1 public release. Has anyone else experienced similar issues? I created FB8818402 for this issue
Posted
by edorphy.
Last updated
.
Post not yet marked as solved
0 Replies
827 Views
So the new Apple Watch Series 6 and SE models tout an always-on altimeter to give more real-time data to users. I develop a fitness application and see many use cases where having access to 'historical altitude data' would be great! I added elevation gain/loss in a feature update earlier this year and used the HKMetadata keys to attribute my workout and segments with that elevation data. Access to historical elevation would enable a ton of new features for developers. Preemptively, I have already created a Feedback item outlining my main use case but in summary, but the gist is that I suggested an API on CMAltimeter to be able to query that historical data the same way as on the CMPedometer class. Reference: https://developer.apple.com/documentation/coremotion/cmpedometer/1613946-querypedometerdata From that, this is my proposed API: public extension CMAltimeter { &#9;&#9;func queryAltimeterData(from: Date, to: Date, withHandler: @escaping CMAltimeterHandler) { } } The new consumer feature wasn't advertised as 'always-on and always recording to a file', but under the hood it might already be doing this, or could be doing this. If you have other ideas and are willing to share in here great. Otherwise submit your feedback, feel free to reference my Feedback item if you're also interested in a new historical query for Apple Watch (or iPhone/iPad too). FB8715215
Posted
by edorphy.
Last updated
.
Post not yet marked as solved
0 Replies
505 Views
When testing In-App Purchase SKProductRequest with WiFi off and no cellular, the failure delegate method gets invoked as one would expect. Unexpectedly, this happens with an undocumented error domain and codes (AMSErrorDomain). Does anyone know where to find public documentation on the AMSErrorDomain? extension Store: SKProductsRequestDelegate {     func request(_ request: SKRequest, didFailWithError error: Error) {         if let storeError = error as? SKError {             os_log("Failed to load products with store kit error: %@", "\(storeError)")         } else {             os_log("Failed to load products with other error: %@", "\(error)")         }     } ... } (lldb) po error Error Domain=AMSErrorDomain Code=203 "Bag Load Failed" UserInfo={NSLocalizedFailureReason=Unable to retrieve p2-product-offers-batch-limit because we failed to load the bag., NSLocalizedDescription=Bag Load Failed, NSUnderlyingError=0x6000004707b0 {Error Domain=AMSErrorDomain Code=206 "Bag Load Failed" UserInfo={NSLocalizedDescription=Bag Load Failed, NSLocalizedFailureReason=Unable to connect to internet.}}} Clearly the underlying localized failure reason makes sense and is user friendly, however the error objects standard localized description 'bag load failed' is far from user friendly and isn't really acceptable to me to put in front of the user. Apple's very own InAppPurchase sample code just pumps the error localizedDescription into a UIAlertController message--but this can be done better! Title: 'Product Request Status', Message: 'Bag Load Failed' How are others handling failures in the SKProductRequest for non-SKError errors?
Posted
by edorphy.
Last updated
.
Post marked as solved
8 Replies
8.9k Views
I figured that I'd get the support for Dark Mode out of the box with UINavigationBar since I use the default opaque color scheme.I've noticed that when I switch the dark mode setting to ON either from environment in xcode, or command center with the screen brightness shortcut, my UINavigationController navbar background stays white but the title text color does change to the dark mode title color, white. White text on white background. I verified that the label is still there and still white using the Debug View Heirarchy within xcode.Sometimes, when I rotate then to landscape, the background will update to dark mode color. It isn't consistent. Same goes for the inverse, changing dark to light mode. Dark text on Dark background color.From a user's perspective, after a swipe-kill and relaunch, the color matches the themes in all orientations and navigation bars.I have my nav bars set to opaque from storyboard. Is there something else I'm missing that needs to be done? I didn't see anything in the adopting dark mode video from WWDC 19.Updated Aug 26, 2019I'm still seeing this behavior in dev beta 8. Created a bug report--hopefully this gets fixed. FB7134275Is anyone else affected by this? Basic app layout similar to either Phone or Clock app.UITabBarController (opaque bottom bar) - UINavigationController (opaque top bar) - UIViewController UINavigationController (opaque top bar) - UITableViewControllerThis is really non-functional because the title color is changed, but the bar color is not changing.Update Jan 6, 2020iOS 13.3 no longer seems to have this issue. I'm not sure in which earlier update this was addressed.
Posted
by edorphy.
Last updated
.
Post not yet marked as solved
0 Replies
338 Views
In my application I query data to compose a "Calorie Profile" for computing BMR and active calories during a workout.Several users have reported, in addition to having been seen in development, that .height and .bodyMass quantity samples are not found when queried on Apple Watch, but exist when queried on the paired/associated iPhone.How long is data made available on the Apple Watch?More specifically, I have a height sample saved on Oct 31st 2019 that is visible in the Health App, and queryable on my app on iPhone. This same sample quantity is not returned on the watch. I'm executing a simple unbounded sample query.For sanity checking, I just saved a new height sample (today) and refreshed the watch app. Less than 5 seconds later, the data was available. Next test was to delete the new sample, so the previous sample was then Oct 31st again. The query returned nothing again.extension HKHealthStore { public func mostRecentHeight(completion: @escaping ((Result&lt;measurement, Error&gt;) -&gt; ())) { self.execute(HKSampleQuery.lastSample(for: .height, completion: { (height, error) in guard let heightQuantity = height else { completion(.failure(QueryError.nilError)) return } let height: Measurement = Measurement(value: heightQuantity.quantity.doubleValue(for: .meter()), unit: .meters) .converted(to: .feet) // TODO: Convert to preferred unit type completion(.success(height)) })) } } private extension HKSampleQuery { static func lastSample(for type: HKQuantityTypeIdentifier, completion: @escaping (HKQuantitySample?, Error?) -&gt; ()) -&gt; HKSampleQuery { guard let sampleType = HKObjectType.quantityType(forIdentifier: type) else { fatalError("Unknown sample type \(type)") } let sortDescriptor: NSSortDescriptor = NSSortDescriptor(key: HKSampleSortIdentifierStartDate, ascending: false) return HKSampleQuery(sampleType: sampleType, predicate: nil, limit: 1, sortDescriptors: [sortDescriptor], resultsHandler: { (query, samples, error) in completion(samples?.first as? HKQuantitySample, error) }) } }
Posted
by edorphy.
Last updated
.
Post marked as solved
2 Replies
1.8k Views
I discovered tonight in iOS 13 beta 8 that there is a new key and value in the advertisement payload. I didn't notice it before and it very well may have been there prior.The key is visible when printing out the advertisementData dict, and a typecast passes as TimeInterval if let timespan = advertisementData["kCBAdvDataTimestamp"] as? TimeInterval { print("Adv date intv \(timespan)") }I didn't see this documented in the API reference under new or old keys. Is this going to be in production? Android API captures timestamp of adv packet since boot--it would be nice to have something similar on iOS (point of reference can be epoch).These are the values that it was decoding as:Adv date intv 588221792.199425Adv date intv 588221793.25799Adv date intv 588221794.237889Adv date intv 588221795.255606Adv date intv 588221796.249666Adv date intv 588221797.243745They're nothing close to the epoch or seconds since boot. I got this out of the payload on my polar HR7.["kCBAdvDataManufacturerData": &lt;6b000900 0000&gt;, "kCBAdvDataTimestamp": 588222227.821503, "kCBAdvDataServiceUUIDs": &lt;__NSArrayM 0x280657cf0&gt;(Heart Rate), "kCBAdvDataLocalName": Polar H7 --------, "kCBAdvDataIsConnectable": 1, "kCBAdvDataTxPowerLevel": 0]
Posted
by edorphy.
Last updated
.
Post not yet marked as solved
1 Replies
493 Views
iOS 13 Beta 4, iPhone Xs.I'm seeing the power alert show even though the options are not specified. I have created a feedback/radar for this: FB6810811If this is the new behavior to expect for GM, the default init documentation should be updated accordingly. Seems like a bug to me as there is a second initializer to explicitly invoke this behavior.import UIKit import CoreBluetooth class ViewController: UIViewController { let centralManager: CBCentralManager = CBCentralManager(delegate: nil, queue: .main) }
Posted
by edorphy.
Last updated
.
Post not yet marked as solved
1 Replies
1.8k Views
When I call the discardWorkout() method on either HKLiveWorkoutBuilder or HKWorkoutBuilder when a user wants to trash a workout, I'm seeing logs emmitted from HealthKit with invalid state transitions.The language of the documentation says discardWorkout() "Stops the collection of data and discards the current results without saving the workout." Reading into the language, I assume you don't need to call endCollection(..) which "Stops the collection of data, sets the workout’s end date, and deactivates the workout builder."When discardWorkout() is called after beginCollection the following is produced:WatchKit Extension[12936:1162537] [workouts] HKLiveWorkoutBuilder_6464 [2AA9]: (#w0) Failed to update target construction state: Error Domain=com.apple.healthkit Code=3 "Unable to handle event 4 from state Active(1); valid transitions are: { 100 = "&lt;error(100): Active(1) -&gt; Error(6)&gt;"; 2 = "&lt;end(2): Active(1) -&gt; AwaitingFinalData(2)&gt;"; // This one looks like what its calling for. 3 = "&lt;finish(3): Active(1) -&gt; AwaitingFinalData(2)&gt;";}" UserInfo={NSLocalizedDescription=Unable to handle event 4 from state Active(1); valid transitions are: { 100 = "&lt;error(100): Active(1) -&gt; Error(6)&gt;"; 2 = "&lt;end(2): Active(1) -&gt; AwaitingFinalData(2)&gt;"; 3 = "&lt;finish(3): Active(1) -&gt; AwaitingFinalData(2)&gt;";}}Decyphering that, looks like builder has internal state called active and wants transition to end (call end collection).Ending collection before discarding gets this instead:WatchKit Extension[13058:1169802] [workouts] HKLiveWorkoutBuilder_827D [2A5A]: (#w0) Failed to update target construction state: Error Domain=com.apple.healthkit Code=3 "Unable to handle event 4 from state Ended(3); valid transitions are: { 100 = "&lt;error(100): Ended(3) -&gt; Error(6)&gt;"; 3 = "&lt;finish(3): Ended(3) -&gt; Saving(4)&gt;"; // But I don't want to finish the workout, I want to discard it!}" UserInfo={NSLocalizedDescription=Unable to handle event 4 from state Ended(3); valid transitions are: { 100 = "&lt;error(100): Ended(3) -&gt; Error(6)&gt;"; 3 = "&lt;finish(3): Ended(3) -&gt; Saving(4)&gt;";}}I've tried on watchOS 5.1 and iOS 12.1 same thing. Has anyone had success calling discardWorkout without getting state machine logs like this emitted over console?It feels like it is working and the previous workoutSession and builder are being disposed just fine when a new session occurrs. Maybe its a false positive error.
Posted
by edorphy.
Last updated
.
Post not yet marked as solved
0 Replies
981 Views
I noticed that between beta 2 and 3 for watchOS 12, the functions for startActivity and endActivity added a date parameter. There also isn't any documentation on the API so I hope it is just a mistake and its an internal function made public. Anyone have any idea what the reason is for this? I can't imagine a use case where when the function is called, it wouldn't be for that moment in time that the date parameter would be set.I'm wondering if these are the mechanism to which the start and end date are being set. If so, they should really be during key state transitions.I.e. startDate should be set when transitioning from notStarted to running OR prepared to running; endDate should be set when transitioning from running or paused to ended OR stopped to ended. I filed a bug against iOS 11 because the startDate is actually set every transition to the running state.
Posted
by edorphy.
Last updated
.