Repository navigation
fix: [SDK-5461] cold-start tap capture on scene apps and launch URL replay - #71
Merged
fadi-george merged 1 commit intoOct 13, 2026
Merged
Conversation
…eplay Hook +[OSNotificationsManager processNotificationResponse:] instead of the UN delegate present at launch, so taps are captured even when Capacitor's NotificationRouter replaces the delegate later (scene-based template). Replay captured responses on the main queue so the SDK's delayed launch URL open actually fires, and make capture/drain thread-safe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8 of 18 tasks
Contributor
The changes here make sense. Are you able to test the scenarios in the table you laid out using the pods demo? I think the linking with cocoapods may be a little different, although I don't expect it to be a problem. Still worth a manual test check. |
Contributor
Author
Tested same scenarios for cocoa-pods and they all pass |
nan-li
approved these changes
Oct 13, 2026
fadi-george
deleted the
fadi/SDK-5461-cold-start-tap-launch-url-scene-based
branch
October 13, 2026 17:09
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
One Line Summary
Fix two iOS cold-start notification tap problems: taps are not captured on Capacitor 8 scene-based apps, and the launch URL never opens.
Details
Motivation
Fixes #69. Both problems were reproduced on a simulator (repro branch:
fadi/sdk-5498-repro, seeexamples/demo/REPRO.mdthere).OSCapacitorLaunchOptionswrappeddidReceiveNotificationResponseon whichever UN delegate existed atdidFinishLaunching, which is the OneSignal SDK's own delegate. In the Capacitor 8 scene template,CAPBridgeViewControlleris created later inSceneDelegate, and Capacitor'sNotificationRouterreplaces that delegate, so the tap went to an unwrapped delegate and was never replayed. This happens wheneverhandleApplicationNotificationsis left at its default.initializereplayed captured responses on Capacitor'sbridgeGCD queue. The iOS SDK opens launch URLs withperformSelector:afterDelay:, which never fires on a thread without a run loop. The click fired, but the URL did not open.Scope
+[OSNotificationsManager processNotificationResponse:], which every tap reaches regardless of the current delegate (the SDK re-swizzles each new delegate, and apps with swizzling disabled forward to it manually). The hook stores the response only untilinitializedrains the queue, and always calls through to the original.pendingColdStartResponsesandconsumeColdStartResponsesare replaced by a single@synchronizeddrainColdStartResponses, since capture runs on main and drain runs on the bridge queue.NotificationRouteras the delegate (the setup guide should recommendios.handleApplicationNotifications: false).Testing
Unit testing
No native test target exists in this repo. JS tests pass (
vp test, 267 tests).Manual testing
iOS 26.2 simulator, Capacitor 8.5.3, OneSignal iOS SDK 5.8.0, SPM demo. Kill the app,
simctl pusha OneSignal payload with launch URLhttps://onesignal.com, tap the banner.handleApplicationNotifications: falsehandleApplicationNotifications: falseEach tap produced exactly one
handleNotificationOpened. Not tested: CocoaPods demo (demo_pods) and a physical device.Affected code checklist
Checklist
Overview
Testing
Final pass
🤖 Generated with Claude Code