Conversation
nan-li
force-pushed
the
nan/sdk-5307
branch
from
September 24, 2026 16:27
689fbc8 to
048ae0e
Compare
The deployment target is iOS 15 since #1749, so every `@available(iOS 13.0, *)` and `@available(iOS 14.0, *)` check is always true, and the reflection that avoided linking iOS 13 APIs at compile time is no longer needed. - Register the UIScene lifecycle observers with the UIScene notification constants instead of string names, in the lifecycle observer, the notifications manager and the remote logging controller. - Drop the iOS 13 guard in `OSBundleUtils.isAppUsingUIScene` and the iOS 14 guard around the ephemeral authorization status. - Read the key window's scene through the typed `UIWindowScene` API in `UIApplication+OneSignal` and `OSMessagingController` instead of `performSelector`. - Call `NSFileHandle writeData:error:` directly in the attachment downloader instead of through `NSInvocation`, and drop the pre-13 `writeData:` fallback. - Remove the matching `#available` checks in OneSignalCoreMocks and the iOS 13 and 14 guards in the dev app.
With the Mac Catalyst floor at 15 alongside iOS, the `@available(iOS 15.0, *)` check around notification action buttons is always true, so `createActionForButton:` can call `UNNotificationActionIcon` and `actionWithIdentifier:title:options:icon:` directly instead of going through `NSClassFromString`, `performSelector` and `NSInvocation`. The pre-15 fallback that built the action without an icon goes with it. A button without an icon key still passes a nil icon, as before.
nan-li
force-pushed
the
nan/sdk-5307
branch
from
September 24, 2026 16:29
048ae0e to
baebc1a
Compare
nan-li
marked this pull request as ready for review
September 24, 2026 16:31
fadi-george
approved these changes
Sep 25, 2026
fadi-george
left a comment
Collaborator
There was a problem hiding this comment.
Potential issues:
- writeData:error: returns a BOOL, might be cleaner to check that instead of fileHandleError
- OSRemoteLoggingControllerTests still posts "UISceneDidEnterBackgroundNotification" by string, could use UIScene.didEnterBackgroundNotification to match
- NSClassFromString for UNTextInputNotificationResponse / UNPushNotificationTrigger in UNUserNotificationCenter+OneSignalNotifications.m could go too if you want the cleanup to be complete
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
Remove the runtime guards and reflection that only existed for iOS 12 through 14, and for iOS 15 on Mac Catalyst. SDK-5307.
Details
Motivation
#1749 raised the deployment target to iOS 15 and #1757 raises Mac Catalyst to match, so every
@available(iOS 13.0, *),@available(iOS 14.0, *)and@available(iOS 15.0, *)check is always true, and theperformSelectorandNSInvocationcalls that avoided linking newer APIs at compile time have no reason left to exist.Scope
Stacked on #1757. The first commit needs only the iOS floor; the second needs the Catalyst floor too.
OSRemoteLoggingControllerregister UIScene observers with theUIScene*notification constants instead of string names.OSBundleUtils.isAppUsingUISceneand the ephemeral authorization check lose their guards andelsebranches.UIApplication+OneSignalandOSMessagingControllerread the key window's scene through the typedUIWindowSceneAPI. A nil key window still reads as active, as it did throughperformSelector.NSFileHandle writeData:error:directly and drops the pre-13writeData:fallback.createActionForButton:buildsUNNotificationActionIconand callsactionWithIdentifier:title:options:icon:directly, and drops the pre-15 fallback that built the action without an icon. A button without an icon key still passes a nil icon.OneSignalCoreMocksand the dev app lose the matching#availablechecks, and the dev app'swillPresentNotificationalways uses the banner and list options.keyWindowreads, the Xcode-eraAUTH_STATUS_EPHEMERALand provisional defines, and the commented-out blocks in the legacyUnitTeststarget.Testing
Unit testing
No new tests. The removed branches were unreachable at the iOS 15 floor, and the existing lifecycle, in-app messaging and notification settings tests cover the paths that remain.
Manual testing
Reduced test plan run serially on an iPhone 17 Pro Max simulator with Xcode 27.0: 353 tests, 0 failures.
build-for-testingproduces the same warning set asmain. With #1757 underneath,OneSignalFrameworkbuilds for Mac Catalyst on Xcode 27.0 at the ios15.0-macabi target. The dev app builds against the resulting frameworks. Not run on a device.Affected code checklist
Checklist
Overview
Testing
Final pass
🤖 Generated with Claude Code