Post

Replies

Boosts

Views

Activity

Reply to CloudKit Subscriptions Not Triggering Push Notifications - No NotificationSend Events
I've created a test project to verify my CloudKit container was set up correctly and my code is correct. https://github.com/ChristopherJones72521/CloudKitPushTest However, I'm experiencing the strangest behavior, if I have both my main project (Strike Force) and test project installed on my device, when I trigger a push notification from one app it is received by the other. If I "Create Test Record" from my test app, the order of notifications is test-minimal-notification, strike-force-test-notification. And, they are both delivered by CloudKitPushTest. If I "Create Test Record" from Strike Force, the order of notifications is strike-force-test-notification, test-minimal-notification. And, they are both delivered by CloudKitPushTest. If only one app (I've tested with both) is installed on my device, then no notifications are received. Any insights here would be greatly appreciated.
Sep ’25
Reply to CloudKit Subscriptions Not Triggering Push Notifications - No NotificationSend Events
CloudKit Push Notifications Not Delivering - Extensive Debugging Completed Issue Summary CloudKit subscriptions are properly configured and triggering, but push notifications are never delivered to devices. After extensive debugging, I've isolated the issue to CloudKit→APNS delivery failure. Environment Xcode: 15.x iOS Target: 17.0+ watchOS Target: 10.0+ CloudKit Database: Both Public and Private Testing Devices: iPhone 15 Pro, Apple Watch Series 9 Environments Tested: Development and Production What's Working ✅ 1. CloudKit Subscriptions All 6 subscription types successfully created and visible in CloudKit Dashboard Subscriptions persist across app launches (verified in dashboard) Subscription predicates correctly configured for each record type: // Example: FriendRequest subscription NSPredicate(format: "toUser == %@", userRecordID) // Example: Challenge subscription NSPredicate(format: "recipientID == %@ AND status == %@", userRecordID, "pending") 2. Device Registration • App successfully requests and receives push notification permissions • Device token obtained and stored • Entitlements correctly configured: aps-environment development • Capability added in App ID configuration 3. CloudKit Records • Records creating/updating successfully • Changes match subscription predicates (verified manually) • Records visible immediately in CloudKit Dashboard 4. App Implementation • Silent notification handling implemented for iOS • Actionable notifications configured for watchOS • Badge management working with local testing What's Not Working ❌ The Critical Issue: CloudKit→APNS Delivery • No notifications are ever delivered to devices • CloudKit Logs show NO "NotificationSend" events • Subscriptions show "Fire Date: None" in dashboard • No push notifications appear in device console logs Debugging Steps Performed 1. Verified Subscription Creation private func createSubscriptions() async throws { let subscriptions = [ createFriendRequestSubscription(), createFriendAcceptedSubscription(), createChallengeSubscription(), // ... etc ] for subscription in subscriptions { do { let saved = try await container.publicCloudDatabase .save(subscription) print("✅ Created subscription: \(saved.subscriptionID)") } catch { print("❌ Subscription error: \(error)") } } } Result: All subscriptions created successfully 2. Tested with Minimal Example Created standalone test file to isolate issue: import CloudKit let subscription = CKQuerySubscription( recordType: "TestRecord", predicate: NSPredicate(value: true), options: [.firesOnRecordCreation] ) let notification = CKSubscription.NotificationInfo() notification.shouldSendContentAvailable = true notification.shouldBadge = true subscription.notificationInfo = notification // Save subscription and create test records Result: Subscription created, records created, but still no notifications 3. Monitored CloudKit Logs • Opened CloudKit Dashboard → Logs • Created records that should trigger notifications • Filtered for "NotificationSend" events Result: No NotificationSend events ever appear 4. Tested Different Configurations • ✅ Tried both development and production environments • ✅ Tested with shouldSendContentAvailable = true (silent) • ✅ Tested with alertBody set (visible notifications) • ✅ Tested on multiple devices • ✅ Tried both public and private database Result: No configuration produces notifications 5. Verified Network & Device Settings • ✅ Devices have active internet connection • ✅ Push notifications enabled in Settings • ✅ No Do Not Disturb or Focus modes active • ✅ Tested on both WiFi and Cellular • ✅ Different Apple IDs tested 6. Checked Container Configuration // Verified correct container let container = CKContainer(identifier: "iCloud.com.strikeforcetechnologies.strikeforce") • ✅ Container ID matches entitlements • ✅ Container is active in CloudKit Dashboard • ✅ Same container used for all operations Code That Should Be Working Subscription Setup public class CloudKitSubscriptionService { func setupSubscriptions() async throws { // Check cache to avoid recreating if let lastCreated = UserDefaults.standard.object(forKey: "lastSubscriptionCreation") as? Date, Date().timeIntervalSince(lastCreated) < 86400 { return } try await createAllSubscriptions() UserDefaults.standard.set(Date(), forKey: "lastSubscriptionCreation") } } Notification Reception // iOS App Delegate func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { print("📱 Received remote notification: (userInfo)") // Never gets called completionHandler(.newData) } What I've Ruled Out • ❌ Not an entitlements issue - Configured correctly • ❌ Not a provisioning profile issue - Includes push capability • ❌ Not a device token issue - Token obtained successfully • ❌ Not a predicate issue - Subscriptions match record changes • ❌ Not a code issue - Multiple implementations tested The Question Why are CloudKit subscriptions not triggering push notifications despite being properly configured? The breakdown appears to be specifically in CloudKit's internal delivery to APNS. There are no "NotificationSend" events in CloudKit logs, suggesting CloudKit isn't even attempting to send notifications to APNS. Additional Information • TSI (Technical Support Incident) filed: [Case #PENDING] • No related issues in Apple System Status • Issue persists across multiple days of testing • Same behavior in TestFlight and Development builds What I Need Help With Has anyone successfully received CloudKit push notifications recently (iOS 17+)? Are there any hidden CloudKit configuration requirements not mentioned in documentation? Is there a way to debug why CloudKit isn't creating "NotificationSend" events? Are there any known issues with CloudKit→APNS delivery? Any insights would be greatly appreciated. I've exhausted all debugging options I can think of and the issue appears to be on Apple's service side. Sample Project I can provide a minimal reproducible example if helpful. The issue reproduces with even the simplest CloudKit subscription setup. Tags: #CloudKit #PushNotifications #APNS #iOS17 #watchOS10
Sep ’25
Reply to Universal Link
Here's a summary of what was going on and how I fixed the issue (Logs are clean now!). The issue was not with the Universal Link configuration itself (the AASA file and Associated Domains were correct), but with a race condition in the SwiftUI app's lifecycle. The Problem: A Timing Issue When the Universal Link is tapped, iOS launches the app and immediately passes the URL via the .onContinueUserActivity modifier. In my original code, this modifier was on the root view in Strike_ForceApp.swift. It would parse the link and post a Notification for the UI to handle. However, at this early stage of the app launch, the destination view (FriendsAndChallengesView) that was supposed to be listening for this notification had not been initialized yet, especially if the user needed to go through a loading or login screen first. As a result, the notification was being posted before any part of the UI was ready to listen for it. The link would open the app, but the "message" to navigate or show an alert was lost. The Solution: Centralizing the Logic in a View Model The fix was to refactor the deep link handling to be independent of the view lifecycle by centralizing the logic in a persistent view model. Centralized State: I moved all the logic for parsing and processing the deep link into the MainTabViewModel. This view model is created once and stays in memory for the entire time the main tab view is on screen. It now has @Published properties to hold the state of any pending deep link (e.g., a profile ID to show or a friend request to accept). Delayed Handling: The .onContinueUserActivity modifier was moved from the root App struct to the MainTabView. This ensures that Universal Links are only caught and processed when the main, authenticated part of the app is actually on screen and ready. State-Driven UI: The MainTabView now observes the @Published properties in the MainTabViewModel. When the view model processes a deep link and updates its state, the MainTabView automatically reacts by presenting the correct UI—either a .sheet for a user profile or an .alert for a friend request. This new architecture completely resolves the race condition. The logic is no longer dependent on a specific view being on screen at the exact moment the link is opened. Instead, the state is managed centrally, and the UI reacts whenever that state changes, which has made the Universal Link handling robust and reliable.
Topic: Code Signing SubTopic: Entitlements Tags:
Sep ’25
Reply to Universal Link
I've just created a minimal test app and the Universal Links seem to work. Unsure then why I'm seeing these errors in the console logs. https://github.com/ChristopherJones72521/MinimalLinkTest
Topic: Code Signing SubTopic: Entitlements Tags:
Sep ’25
Reply to Universal Link
Sorry for omitting these details in my original post. PLATFORM AND VERSION iOS Development environment: Xcode Version 16.4 (16F6), macOS 15.5 (24F74) Run-time configuration: iOS 18.5 CURRENT BEHAVIOR When I tap "Add Friends" from my iOS app it generates a unique token and to be shares via Universal Link and displays the share sheet for me to select how I want to share this. https://www.strike-force.app/invite?token=781E1E89-BEAC-4C5C-B3F1-2EC916566D2C This is in dev when I build from XCode. If I perform this action from TestFlight, the button is unresponsive. I assume it's because of the errors below. Cannot issue sandbox extension for URL:https://www.strike-force.app/invite?token=781E1E89-BEAC-4C5C-B3F1-2EC916566D2C App is being debugged, do not track this hang Hang detected: 0.37s (debugger attached, not reporting) 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 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 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 So, I've been unable to test if the Universal Link strategy works with my testers in Test Flight. If I click the link myself it just opens my app. I've implemented Friend Requests two ways. One is a direct linking between friends using a unique token. The other is a generic sharing of the user's profile which then results in a friend request from the person who initiates the request to that user. https://www.strike-force.app/profile?userID=000773.de39195514404b7b9c60b14a7f1f8048.0122 This produces a similar error. Cannot issue sandbox extension for URL:https://www.strike-force.app/profile?userID=000773.de39195514404b7b9c60b14a7f1f8048.0122 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
Topic: Code Signing SubTopic: Entitlements Tags:
Sep ’25