feat: [SDK-4775] add location opt-out support#184
Conversation
b139868 to
8b79c11
Compare
|
One thing I'd flag before merge: on iOS the missing-module diagnostic uses Android is fine since Suggest switching iOS to (Smaller, related: the |
Co-authored-by: Cursor <cursoragent@cursor.com>
Description
One Line Summary
Adds an MSBuild-controlled way to exclude the native OneSignal location module and includes a no-location MAUI demo.
Expect in Console.app:

Expect in ADB/LogCat:

Demo app:

Details
Motivation
Apps that do not use OneSignal location features should be able to omit native location dependencies while keeping notification, user, IAM, outcome, and live activity behavior available.
Scope
This introduces
<OneSignalDisableLocation>true</OneSignalDisableLocation>for source/package builds, conditionally excludes iOS and Android location native assets, and makes location API calls gracefully no-op when the native module is absent. It also addsexamples/demo-no-locationwith APNs capability and updates demo scripts/styles shared by the examples.Testing
Unit testing
No unit tests were added; this change primarily affects MSBuild item inclusion and native app packaging paths.
Manual testing
From
examples/demo-no-location:./run-android.shon an emulator, tapped TEST LOCATION REQUEST, and confirmed in Logcat that the location module was excluded (missing-module error, no location dependency linked)../run-ios.shon a simulator, tapped TEST LOCATION REQUEST, and confirmed in Console that the location module was missing (missing-module error, noOneSignalLocation.frameworkin the app).Affected code checklist
Checklist
Overview
Testing
Final pass
Made with Cursor