feat: [SDK-5193] let an app opt out of subscription ID copy in Info.plist - #1739
Merged
Conversation
nan-li
marked this pull request as ready for review
September 10, 2026 23:47
nan-li
force-pushed
the
nan/sdk-5088
branch
from
September 11, 2026 17:04
389ab43 to
47a641b
Compare
…list The gesture is on by default and, until now, only OneSignal could turn it off, through the remote kill switch. An app that does not want a pasteboard write in production can now set OneSignal_disable_subscription_id_copy to YES in Info.plist, read the same way as OneSignal_disable_badge_clearing. With the key set the detector never registers its observers, so nothing is counted, written or recorded. That is deliberately stricter than the remote kill switch, which still records disabled so attempts can be counted: an app that opted out has said no. One INFO line at start says the key was honored, so a typo in it is not silent. The started latch still flips, so the recovery path's second start stays quiet. No public API, so wrapper SDKs need no change to expose it.
nan-li
force-pushed
the
nan/sdk-5193
branch
from
September 11, 2026 17:34
15104c0 to
47f75d9
Compare
Collaborator
|
Potential issues:
|
A String value such as YES now opts out, matching the dynamic boolValue the other Info.plist keys use, instead of being ignored. Also renames killSwitchKey to remoteKillSwitchKey to tell the two keys apart.
Contributor
Author
good find, in 1c7d2d4 String now goes through boolValue like the other keys, with the plist-XML-driven tests in OSDeviceGestureDetectorInfoPlistTests. |
fadi-george
approved these changes
Sep 11, 2026
Collaborator
|
My bad, I accidentally merged. |
Contributor
Author
No probs! thanks for approving |
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
Lets an app turn off subscription ID copy with an Info.plist key.
Details
Motivation
The gesture in #1730 is on by default, and the only switch is OneSignal's remote kill switch. An app that doesn't want a pasteboard write in production should be able to say so itself, in its own Info.plist, without a support ticket.
Ticket SDK-5193. Follows #1730, which merged as c23c6f9; this PR targets main.
Scope
OneSignal_disable_subscription_id_copyset toYESin Info.plistOneSignal_disable_swizzling,OneSignal_suppress_launch_urls,OneSignal_disable_badge_clearing): a Boolean or Number counts by value and a String throughNSString.boolValue, so<true/>and<string>YES</string>both opt out. That matters because Xcode's plist editor stores a new row as a String unless its type is changed. A missing or mistyped value leaves the gesture on instead of crashing onboolValuethe way the Objective-C reads would.disabledso we can count attempts; an app that opted out has said no.start()stays quiet.Other
The docs page and release notes need to say the feature is on by default and name the key.
Testing
Unit testing
OSDeviceGestureDetectorTestsinjects the opt-out and asserts, through the observer-counting center, that no observers register, that six cycles write nothing and record nothing, and that a second start registers nothing either.OSDeviceGestureDetectorInfoPlistTestsdeserialises each Info.plist value shape from its literal XML and checks the parse:<true/>,<integer>1</integer>,<real>1.0</real>and the stringsYES,yes,trueand1opt out;<false/>,<integer>0</integer>and the stringsNO,false,0and empty do not; nil, array, dict, date and data values leave the gesture on. The parse tests fail against the previousNSNumber-only read. 187 OneSignalOSCore tests pass serially, SwiftLint clean apart from the pre-existing file length warning on the test file.Manual testing
Not run on a device. The read is the same
Bundle.mainlookup the other Info.plist switches use.Affected code checklist
Checklist
Overview
Testing
Final pass