Skip to content

feat: [SDK-4194] support disabling location module#1157

Merged
fadi-george merged 1 commit into
mainfrom
fadi/sdk-4194
Jun 9, 2026
Merged

feat: [SDK-4194] support disabling location module#1157
fadi-george merged 1 commit into
mainfrom
fadi/sdk-4194

Conversation

@fadi-george

Copy link
Copy Markdown
Collaborator

One Line Summary

Adds build-time support for excluding the native OneSignal location module from Flutter apps.

Motivation

Apps that do not use OneSignal.Location should 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:

  • iOS CocoaPods: $OneSignalDisableLocation = true switches from the aggregate OneSignalXCFramework pod to non-location subspecs.
  • iOS SwiftPM: OneSignalDisableLocation=true or ONESIGNAL_DISABLE_LOCATION=true omits OneSignalLocation while resolving packages.
  • Android: OneSignal_disableLocation=true switches from com.onesignal:OneSignal to core, notifications, and in-app-messages modules.
  • Android location channel calls safely no-op or return false when the native location module is unavailable.
  • README documents the new flags.

Testing

  • Ran flutter test.
  • Ran flutter build apk --debug -POneSignal_disableLocation=true in examples/demo.
  • Ran ruby -c ios/onesignal_flutter.podspec.
  • Verified swift package dump-package includes OneSignalLocation by default and omits it with OneSignalDisableLocation=true.
  • Verified the Android SDK version parser returns 5.9.3 after moving the dependency version into oneSignalVersion.

Affected code checklist

  • Notifications
  • In-App Messaging
  • Public API / integration behavior
  • Outcomes
  • Sessions

Checklist

  • I have filled out all required sections above.
  • PR does one thing.
  • Testing is documented.
  • I have reviewed this PR myself.

Made with Cursor

@fadi-george
fadi-george requested a review from a team as a code owner June 9, 2026 18:41
@fadi-george

Copy link
Copy Markdown
Collaborator Author

@claude review

@nan-li nan-li left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@fadi-george
fadi-george merged commit ef7e711 into main Jun 9, 2026
5 checks passed
@fadi-george
fadi-george deleted the fadi/sdk-4194 branch June 9, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants