chore: [SDK-4728] add no-location demo and switch to env var opt-out#1956
Merged
Conversation
sherwinski
requested changes
Jun 9, 2026
sherwinski
left a comment
Contributor
There was a problem hiding this comment.
- https://github.com/OneSignal/react-native-onesignal/blob/fadi/sdk-4728-cleanup/examples/demo/ios/demo/vine_boom.wav is still on disk even though it's dereferenced in
res/raw. We should remove it there too. - To avoid headaches in testing, we should normalize how we parse
ONESIGNAL_DISABLE_LOCATIONfrom env:
a. Android:value.toString().toBoolean()is case-insensitive, sotrue/TRUE/Trueall work, but1does not.
b. iOS:ENV['ONESIGNAL_DISABLE_LOCATION'] == 'true'requires case-sensitive exact match, soTRUEand1both fail.
…ATION env var Replace the Android gradle property (OneSignal_disableLocation) and the iOS Podfile global ($OneSignalDisableLocation) with a single ONESIGNAL_DISABLE_LOCATION environment variable read at dependency resolution time, so the same knob works for both platforms. Co-authored-by: Cursor <cursoragent@cursor.com>
Remove leftover cruft from the demo (the unused com.demo Android package and the orphaned vine_boom.wav asset plus its dangling Xcode references), and switch the demo to the ONESIGNAL_DISABLE_LOCATION environment variable for both iOS (Podfile) and Android (run script). Co-authored-by: Cursor <cursoragent@cursor.com>
a986bb1 to
9b8b89c
Compare
Move the no-location environment variable out of the Podfile and onto the package scripts that run CocoaPods resolution, keeping the Podfile conventional while preserving the demo's self-contained setup. Co-authored-by: Cursor <cursoragent@cursor.com>
Update the e2e workflow version resolver after the Android dependency string moved behind the oneSignalVersion variable. Co-authored-by: Cursor <cursoragent@cursor.com>
Clarify that GitHub Actions can set ONESIGNAL_DISABLE_LOCATION at the job or step level so CocoaPods and Gradle inherit it during dependency resolution and builds. Co-authored-by: Cursor <cursoragent@cursor.com>
1f0fc7d to
b0a12cb
Compare
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
Adds the
demo-no-locationexample app and switches the disable-location opt-out to a singleONESIGNAL_DISABLE_LOCATIONenvironment variable.Details
Motivation
Stacked on top of #1953. That PR added the ability to exclude OneSignal's native location module. This PR:
OneSignal_disableLocationgradle property and iOS$OneSignalDisableLocationPodfile global) with a singleONESIGNAL_DISABLE_LOCATIONenvironment variable, read at dependency-resolution time on both platforms. This keeps the opt-out consistent across iOS (CocoaPods) and Android (Gradle), and matches the approach used in the OneSignal Flutter SDK.examples/demo-no-locationapp that proves push + in-app messaging work without linking the native location module, and cleans up cruft that was copied into it (the unusedcom.demoAndroid package and the orphanedvine_boom.wavasset with its dangling Xcode references).Scope
android/build.gradleandreact-native-onesignal.podspecnow readONESIGNAL_DISABLE_LOCATION; default behavior (location included) is unchanged when the variable is unset.Testing
Manual testing
Validated with clean reinstalls in
examples/demo-no-location:pod installwith the env var, via the Podfile):Podfile.lockresolvesreact-native-onesignaltoOneSignalXCFramework/OneSignal+OneSignalXCFramework/OneSignalInAppMessagesonly — noOneSignalLocationsubspec../gradlew :app:dependencieswith the env var): resolvescom.onesignal:core+notifications+in-app-messages(+ transitiveotel), with nocom.onesignal:locationand no aggregatecom.onesignal:OneSignal.com.onesignal:OneSignalpullscom.onesignal:locationback in, confirming the variable is what excludes the module.Affected code checklist
Checklist
Overview
Testing
Made with Cursor