We seem to be dealing with a weird issue where the clinical health records entitlement keeps on getting added into our final embedded.mobileprovision when we prepare a build for distribution.
We seem to get this in the final package.
<key>com.apple.developer.healthkit.access</key>
<array>
<string>health-records</string>
</array>
But in our projects entitlement file there is no reference to health records. Below is the raw values inside of this file.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.healthkit</key>
<true/>
<key>com.apple.developer.healthkit.access</key>
<array/>
<key>com.apple.security.application-groups</key>
<array>
<string>group.xxxxx</string>
</array>
</dict>
</plist>
And also in the project this isn't selected in the capabilities section either. Has anyone come across this issue before where Xcode automatically adds clinical records even though you haven't selected the checkbox.
Post
Replies
Boosts
Views
Activity
I seem to be experiencing a memory leak with compositional layout where my group size is causing my header and cells to experience extremely high memory usage. Just to explain in more detail I'm trying to layout a horizontal grid where items have a 1:1 ratio based on the width of the screen.
In my case I want 5 items per row which are 20% of the screen size with 1px spacing in between each item. And the height of the headers should be estimated so they are self sizing based on their content. So below is a snippet of what I have so far below.
		// MARK: Sizing Constants
		private let itemRatio: CGFloat = 0.2
		
		var layout: UICollectionViewCompositionalLayout {
				
				UICollectionViewCompositionalLayout { [weak self] (sectionIndex, _) -> NSCollectionLayoutSection? in
						
						guard let self = self else { return nil }
												
						let item = NSCollectionLayoutItem(layoutSize: .init(widthDimension: .fractionalWidth(self.itemRatio),
																																heightDimension: .fractionalWidth(self.itemRatio)))
						item.contentInsets.trailing = 1
						item.contentInsets.bottom = 1
						let group = NSCollectionLayoutGroup.horizontal(layoutSize: .init(widthDimension: .fractionalWidth(1),
																																						 heightDimension: .fractionalWidth(self.itemRatio)),
																													 subitems: [item])
						let section = NSCollectionLayoutSection(group: group)
						
						// Enable this when finish working on the cells
						section.boundarySupplementaryItems = [
								.init(layoutSize: .init(widthDimension: .fractionalWidth(1),
																				heightDimension: .estimated(38)), // Investigate why this is causing a memory leak...
											elementKind: "CollectionViewHeader",
											alignment: .topLeading)
						]
						return section
				}
		}
If I change the following code above to this below where I define an absolute value for the section header, everything renders fine and there are no issues.
				// MARK: Sizing Constants
				private let itemRatio: CGFloat = 0.2
				
				var layout: UICollectionViewCompositionalLayout {
						
						UICollectionViewCompositionalLayout { [weak self] (sectionIndex, _) -> NSCollectionLayoutSection? in
								
								guard let self = self else { return nil }
														
								let item = NSCollectionLayoutItem(layoutSize: .init(widthDimension: .fractionalWidth(self.itemRatio),
																																		heightDimension: .fractionalWidth(self.itemRatio)))
								item.contentInsets.trailing = 1
								item.contentInsets.bottom = 1
		
								let group = NSCollectionLayoutGroup.horizontal(layoutSize: .init(widthDimension: .fractionalWidth(1),
																																								 heightDimension: .fractionalWidth(self.itemRatio)),
																															 subitems: [item])
								let section = NSCollectionLayoutSection(group: group)
								
								// Enable this when finish working on the cells
								section.boundarySupplementaryItems = [
										.init(layoutSize: .init(widthDimension: .fractionalWidth(1),
		//																				heightDimension: .estimated(38)), // Investigate why this is causing a memory leak...
																						heightDimension: .absolute(sectionIndex < 1 ? 120 : 72)), // Investigate why this is causing a memory leak...
													elementKind: "CollectionViewHeader",
													alignment: .topLeading)
								]
		
								return section
						}
				}
Any ideas why this might be the case?
Got a really weird dilemma. Basically one of our Apps we've been trying to submit this for a while now and it keeps on getting rejected because the reviewers test device is failing to download the assets from Apple On Demand, this is really frustrating since this is something that is out of our control and we can not control the delivery of these assets from Apple's servers.
Below is a snippet of the code we are using to request Assets from the server.
let req = NSBundleResourceRequest(tags: [tag])
requests[tag] = req
req.conditionallyBeginAccessingResources { isDownloaded in
guard !isDownloaded
else { return update(.success(Demand(id: tag, status: .ready))) }
req.beginAccessingResources { error in
if let error = error {
update(.failure(error))
} else {
update(.success(Demand(id: tag, status: .ready)))
}
}
}
We seem to be hitting line 21 where the asset is failing to download which is something out of our control. I would really appreciate if anyone has come across this issue or if one of the Apple Engineers can look at this and provide support.
Currently, there seems to be an issue with the Product API when requesting products with an array I don't get an error instead in the console when testing with a sandbox box account I get the following warning.
[StoreKit] Did not receive any products or error for products request.
Something that's strange which leaves me to believe this may be an internal issue at Apple. Is that if you set up the Xcode project with a StoreKit Configuration file. The products are retrieved just fine and you can mock/test out consumables locally and simulate purchasing great.
The issue seems to happen when you're either trying to test via Testflight or if you're trying to use a sandbox account. Something i've tripled check to make sure i've setup the products properly in AppStoreConnect are:
Accepted the latest banking agreements and added bank info
Made sure that my in-app purchases have a status of "Ready to Submit" at a bare minimum (They have a price & all the relevant info filled in)
Made sure the bundle identifiers are all correct and matching
Validate the API with the storekit configuration file which it does
Added In App Purchase Capability
Please can someone at Apple investigate this since I'm unable to get past an app submission due to the reviewer not being able to see these products even though I can locally with the storekit configuration file which is pretty frustrating.
I’m using iOS16.1.1 & Xcode 14.0.1
I've realised with the sample code from the WWDC video below I'm getting the following error when trying to use the iPhone simulator and apple watch simulator paired.
Whenever i try to test out the sample project I'm getting the following error.
Failed to send data: Error Domain=com.apple.healthkit Code=300 "Remote device is unreachable" UserInfo={NSLocalizedDescription=Remote device is unreachable, NSUnderlyingError=0x600000c9c900 {Error Domain=RPErrorDomain Code=-6727 "kNotFoundErr ('rapport:rdid:PairedCompanion' not found)" UserInfo={cuErrorDesc=kNotFoundErr ('rapport:rdid:PairedCompanion' not found), cuErrorMsg='rapport:rdid:PairedCompanion' not found, NSLocalizedDescription=kNotFoundErr ('rapport:rdid:PairedCompanion' not found)}}}
Is it not possible to not test out the new WorkoutKit mirroring API's using the simulator?
Currently right now if you run the project you'll notice that you can start a workout session on the iPhone > Apple Watch but there is no way to control and mirror on both devices at the moment i.e You can't control the iPhone app on the Apple Watch and vice versa.
Also because of this the iPhone can't send data to the Apple Watch i.e. pause, end, water etc. I'm guessing this is meant to be possible since it seems a bit strange to only be able to test this out with actual devices.
WWDC Session
https://developer.apple.com/wwdc23/10023
Sample Code
https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/building_a_multidevice_workout_app