feat: [SDK-4194] support disabling location module#1157
Merged
Conversation
fadi-george
force-pushed
the
fadi/sdk-4194
branch
from
June 9, 2026 20:20
c8ac50e to
f35e3d8
Compare
Collaborator
Author
|
@claude review |
fadi-george
force-pushed
the
fadi/sdk-4194
branch
from
June 9, 2026 23:32
bc856e6 to
0641a34
Compare
nan-li
approved these changes
Jun 9, 2026
nan-li
left a comment
Contributor
There was a problem hiding this comment.
Nice getting the subspec and product decomp right, its easy to get it wrong.
We'll still need to update the docs with the info in readme
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.
One Line Summary
Adds build-time support for excluding the native OneSignal location module from Flutter apps.
Motivation
Apps that do not use
OneSignal.Locationshould be able to avoid linking native location dependencies so iOS and Android builds do not include location-specific modules or permissions.Scope
This PR adds disable-location support across Flutter native integration paths:
$OneSignalDisableLocation = trueswitches from the aggregateOneSignalXCFrameworkpod to non-location subspecs.OneSignalDisableLocation=trueorONESIGNAL_DISABLE_LOCATION=trueomitsOneSignalLocationwhile resolving packages.OneSignal_disableLocation=trueswitches fromcom.onesignal:OneSignaltocore,notifications, andin-app-messagesmodules.falsewhen the native location module is unavailable.Testing
flutter test.flutter build apk --debug -POneSignal_disableLocation=trueinexamples/demo.ruby -c ios/onesignal_flutter.podspec.swift package dump-packageincludesOneSignalLocationby default and omits it withOneSignalDisableLocation=true.5.9.3after moving the dependency version intooneSignalVersion.Affected code checklist
Checklist
Made with Cursor