Skip to content

chore: [SDK-4728] support Gradle property override#1959

Merged
fadi-george merged 1 commit into
mainfrom
fg/4728-override
Jun 10, 2026
Merged

chore: [SDK-4728] support Gradle property override#1959
fadi-george merged 1 commit into
mainfrom
fg/4728-override

Conversation

@fadi-george

@fadi-george fadi-george commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Description

One Line Summary

Allow Android builds to disable the OneSignal location module through the persistent onesignal.disableLocation Gradle property.

Details

Motivation

ONESIGNAL_DISABLE_LOCATION works well for shell and CI builds, but Android projects and Expo prebuild output need a file-backed option that Gradle can read on later invocations. This adds an idiomatic Gradle property fallback while keeping the existing environment variable behavior.

Scope

This affects Android dependency selection only. The existing ONESIGNAL_DISABLE_LOCATION environment variable remains supported and takes precedence over the Gradle property. iOS behavior is unchanged.

Testing

Unit testing

No new unit tests were added because this change is in Gradle dependency selection logic.

Manual testing

  • Ran vp check && vp test
  • Rebuilt and reinstalled the local SDK tarball into examples/demo-no-location
  • Verified env -u ONESIGNAL_DISABLE_LOCATION ./android/gradlew -p android -Ponesignal.disableLocation=true :app:dependencies --configuration debugRuntimeClasspath excludes com.onesignal:location
  • Verified the same dependency graph with neither env nor Gradle property includes com.onesignal:OneSignal and com.onesignal:location
2026-06-10 10:04:42.276 19989-20049 OneSignal               com.onesignal.example                E  [mqt_v_native] OneSignal location module is not available. Add the location dependency to use OneSignal.Location.
                                                                                                    java.lang.Exception: Must include gradle module com.onesignal:Location in order to use this functionality!
                                                                                                    	at com.onesignal.location.internal.MisconfiguredLocationManager$Companion.getEXCEPTION(MisconfiguredLocationManager.kt:19)
                                                                                                    	at com.onesignal.location.internal.MisconfiguredLocationManager$Companion.access$getEXCEPTION(MisconfiguredLocationManager.kt:18)
                                                                                                    	at com.onesignal.location.internal.MisconfiguredLocationManager.requestPermission(MisconfiguredLocationManager.kt:16)
                                                                                                    	at com.onesignal.rnonesignalandroid.RNOneSignal.requestLocationPermission(RNOneSignal.java:332)
                                                                                                    	at com.facebook.jni.NativeRunnable.run(Native Method)
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:995)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:103)
                                                                                                    	at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.kt:21)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:248)
                                                                                                    	at android.os.Looper.loop(Looper.java:338)
                                                                                                    	at com.facebook.react.bridge.queue.MessageQueueThreadImpl$Companion.startNewBackgroundThread$lambda$0(MessageQueueThreadImpl.kt:152)
                                                                                                    	at com.facebook.react.bridge.queue.MessageQueueThreadImpl$Companion.$r8$lambda$YYXYCFexeoKtAeDpeNYkxZZlpbA(Unknown Source:0)
                                                                                                    	at com.facebook.react.bridge.queue.MessageQueueThreadImpl$Companion$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
                                                                                                    	at java.lang.Thread.run(Thread.java:1119)

Affected code checklist

  • Notifications
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

Made with Cursor

@fadi-george fadi-george requested a review from a team as a code owner June 10, 2026 16:39
@fadi-george fadi-george merged commit f58e657 into main Jun 10, 2026
7 checks passed
@fadi-george fadi-george deleted the fg/4728-override branch June 10, 2026 20:10
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