Hello,
I'm developing a feature for my app, that allows users to challenge their friends. The friend request functionality is built using Universal Links, but I've run into a significant issue.
The Universal Links are correctly deep-linking into the app. However, once the app opens, nothing happens—the friend request acceptance or rejection flow does not occur. This prevents users from completing friend requests and building their friend list.
Here are examples of the Universal Links I'm generating:
https://www.strike-force.app/invite?type=invite&userID=...
https://www.strike-force.app/invite?type=invite&friendRequestID=...
https://www.strike-force.app/profile?userID=...
I've recently updated my cloudflare-worker.js to serve a paths array of ["*"] in the AASA file, so I believe the links themselves should be valid.
Technical Details & Error Logs
In the console, I am consistently seeing the following error message:
Cannot issue sandbox extension for URL:https://www.strike-force.app/invite?token=7EF1E439-090B-4DF2-BE64-9904F50A3F8B
Received port for identifier response: <(null)> with error:Error Domain=RBSServiceErrorDomain Code=1 "Client not entitled" UserInfo={RBSEntitlement=com.apple.runningboard.process-state, NSLocalizedFailureReason=Client not entitled, RBSPermanent=false} elapsedCPUTimeForFrontBoard couldn't generate a task port
This error appears to be related to entitlements and process state, but I am not sure if it's the root cause of the Universal Link issue or a separate problem. The 'Client not entitled' error on line 3 has had me chasing down entitlements issues. But, I've added the Associated Domains entitlement with the proper applink URLs and verified this in my Developer Portal. I've regenerated my provisioning profile, manually installed it, and selected/de-selected Automatically Manage Signing. As well I've verified my AASA file and it's correctly being served via HTTPS and returning a 200.
curl -i https://strike-force.app/.well-known/apple-app-site-association
curl -i https://www.strike-force.app/.well-known/apple-app-site-association
I am looking for guidance on why the friend request flow is not being triggered after a successful deep-link and how I can fix the related error.
Any insights or suggestions would be greatly appreciated.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Overview of Issue
My implementation of HealthKit is no longer able to read values due to authorization issues (ex. "HealthKitService: Not authorized to read HKQuantityTypeIdentifierHeight. Status: 0"). I have been through every conceivable debugging step including building a minimal project that just requests HealthKit data and the issue has persisted. I've tried my personal as well as Organizational developer teams. My MacOS and Mac Mini. Simulator and personal device. Rechecked entitlements, reprovisioned certificates. This makes no sense. And I have been unable to find anything similar in the Developer forums or documentation.
The problem occurs during the onboarding flow when the app requests HealthKit permissions. Even when the user grants permission in the HealthKit authorization sheet, the authorizationStatus for characteristic data types (like Biological s3x and Date of Birth) and quantity data types (like Height and Weight) consistently returns as .sharingDenied. This prevents the app from pre-filling the user's profile with their HealthKit data, forcing them to enter it manually.
The issue seems to be environmental rather than a specific code bug, as it has been reproduced in a minimal test case app and persists despite extensive troubleshooting.
Minimal test project: https://github.com/ChristopherJones72521/HealthKitTestApp**
STEPS TO REPRODUCE
Build app, attempt to sign in. No data is imported into the respective fields in the main app. Console logs confirm.
PLATFORM AND VERSION
iOS
Development environment: Xcode Version 16.4 (16F6), macOS 15.5 (24F74)
Run-time configuration: iOS 18.5
Relevant Code Snippets
Here are the key pieces of code that illustrate the implementation and the problem:
1. Requesting HealthKit Permissions (HealthKitService.swift)
This function is called to request authorization for the required HealthKit data types. The typesToRead and typesToWrite are defined in a centralized HealthKitTypes struct.
// HealthKitService.swift
func requestPermissions(completion: @escaping (Bool, Error?) -> Void) {
guard HKHealthStore.isHealthDataAvailable() else {
completion(false, HealthKitError.notAvailable)
return
}
let typesToRead: Set<HKObjectType> = [
HKObjectType.characteristicType(forIdentifier: .dateOfBirth)!,
HKObjectType.characteristicType(forIdentifier: .biologicals3x)!,
HKObjectType.quantityType(forIdentifier: .height)!,
HKObjectType.quantityType(forIdentifier: .bodyMass)!
]
let typesToWrite: Set<HKSampleType> = [
HKObjectType.workoutType(),
HKObjectType.quantityType(forIdentifier: .activeEnergyBurned)!
]
healthStore.requestAuthorization(toShare: typesToWrite, read: typesToRead) { success, error in
DispatchQueue.main.async {
if let error = error {
print("HealthKitService: Error requesting authorization: \(error.localizedDescription)")
completion(false, error)
} else {
print("HealthKitService: Authorization request completed. Success: \(success)")
completion(success, nil)
}
}
}
}
2. Reading Biological s3x (HealthKitService.swift)
This function attempts to read the user's biological s3x. The print statements are included to show the authorization status check, which is where the issue is observed.
// HealthKitService.swift
func readBiologicals3x() async throws -> HKBiologicals3xObject? {
guard HKHealthStore.isHealthDataAvailable() else { throw HealthKitError.notAvailable }
let s3xAuthStatus = healthStore.authorizationStatus(for: HKObjectType.characteristicType(forIdentifier: .biologicals3x)!)
print("HealthKitService: Auth status for Biological s3x: \(s3xAuthStatus.rawValue)")
guard s3xAuthStatus == .sharingAuthorized else {
print("HealthKitService: Not authorized to read Biological s3x.")
throw HealthKitError.notAuthorized
}
do {
return try healthStore.biologicals3x()
} catch {
print("HealthKitService: Error executing biologicals3x query: \(error.localizedDescription)")
throw HealthKitError.queryFailed(error)
}
}
3. Calling HealthKit Functions During Onboarding (OnboardingFlowView.swift)
This is how the HealthKitService is used within the onboarding flow. The requestHealthKitAndPrefillData function is called after the user signs in, and it attempts to read the data to pre-fill the profile form.
// OnboardingFlowView.swift
func readHealthKitDataAsync() async {
print("Attempting to read HealthKit data async...")
// ... (calls to HealthKitService.shared.readDateOfBirth(), readHeight(), etc.)
do {
if let biologicals3xObject = try await HealthKitService.shared.readBiologicals3x() {
if self.selectedGender == nil {
switch biologicals3xObject.biologicals3x {
case .female: self.selectedGender = .female
case .male: self.selectedGender = .male
case .other: self.selectedGender = .other
default:
break
}
}
}
} catch {
print("OnboardingFlowView: Error reading Biological s3x: (error.localizedDescription)")
}
print("OnboardingFlowView: Finished HealthKit data processing.")
}
Console Logs
Attempting to read HealthKit data async...
HealthKitService: Reading Date of Birth...
HealthKitService: Current auth status for DOB (during read attempt): 0
HealthKitService: Not authorized to read Date of Birth. Status: 0
OnboardingFlowView: Error reading Date of Birth: The operation couldn’t be completed. (Strike_Force.HealthKitError error 2.)
HealthKitService: Reading Height...
HealthKitService: Current auth status for HKQuantityTypeIdentifierHeight (during read attempt): 0
HealthKitService: Not authorized to read HKQuantityTypeIdentifierHeight. Status: 0
OnboardingFlowView: Error reading Height: The operation couldn’t be completed. (Strike_Force.HealthKitError error 2.)
HealthKitService: Reading Weight (Body Mass)...
HealthKitService: Current auth status for HKQuantityTypeIdentifierBodyMass (during read attempt): 0
HealthKitService: Not authorized to read HKQuantityTypeIdentifierBodyMass. Status: 0
OnboardingFlowView: Error reading Weight: The operation couldn’t be completed. (Strike_Force.HealthKitError error 2.)
HealthKitService: Pre-read check for Biologicals3x auth status: 1 (Denied)
HealthKitService: Reading Biological s3x...
HealthKitService: Current auth status for Biological s3x (during read attempt): 1
HealthKitService: Not authorized to read Biological s3x. Status: 1
OnboardingFlowView: Error reading Biological s3x: The operation couldn’t be completed. (Strike_Force.HealthKitError error 2.)