chore: added permission setup#642
Conversation
Sample app builds 📱Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/real-time-location #642 +/- ##
==========================================================
Coverage ? 68.37%
Complexity ? 760
==========================================================
Files ? 142
Lines ? 4303
Branches ? 580
==========================================================
Hits ? 2942
Misses ? 1141
Partials ? 220 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
|
Build available to test |
📏 SDK Binary Size Comparison ReportNo changes detected in SDK binary size ✅ |
|
|
| ) : LocationError() { | ||
| override fun toString(): String = "LocationError.Unknown(message=$message, cause=$cause)" | ||
| } | ||
| } |
There was a problem hiding this comment.
LocationError sealed class is unused dead code
Low Severity
The LocationError sealed class and all its subclasses (PermissionDenied, TrackingDisabled, LocationServicesDisabled, ServiceUnavailable, Timeout, Unknown) are defined and publicly exported in the API but are never used anywhere in the codebase. No method returns or throws these error types. This appears to be scaffolding for future features but currently adds unused public API surface.
|
|
|
|
mahmoud-elmorabea
left a comment
There was a problem hiding this comment.
Shall we hold off a bit till we agree on set of behaviors and public API to avoid reworking some of those public types?
Summary
This PR implements the permission checking and consent management layer for the Location module. It establishes the foundation for location tracking by providing:
Cross-Platform Architecture
The public API is designed to be platform-agnostic, enabling wrapper SDKs (React Native, Flutter, Expo) to use a single interface without platform-specific branching.
┌──────────────
│ WRAPPER SDKs │
│ (React Native / Flutter / Expo) │
└───────────────
│
┌───────────▼
│ UNIFIED PUBLIC API │
│ │
│ • permissionStatus() │
│ • setTrackingEnabled()│
│ • canTrackLocation() │
│ • getTrackingEligibility() │
└───────────
│
┌─────────▼
│ ANDROID (internal)│
│ • FusedLocation │
│ • GMS checks │
│ • Permission APIs │
└─────────
Test Plan
Note
Establishes the location module’s permission/consent foundation and eligibility checks with a unified API for wrappers.
ModuleLocationwithpermissionStatus(),isLocationServicesEnabled(),setLocationTrackingEnabled(),isLocationTrackingEnabled(),canTrackLocation(),getTrackingEligibility(),getRequiredPermissions(), andonPermissionResult(); wires init to SDK reset eventsLocationComponentprovidingLocationPreferenceStore,LocationPermissionsHelper, andTrackingEligibilityChecker; reset clears stored stateLocationPermissionStatus,LocationTrackingEligibility(Eligible/NotEnabled/PermissionRequired/LocationServicesDisabled)LocationError(PermissionDenied/TrackingDisabled/LocationServicesDisabled/ServiceUnavailable/Timeout/Unknown)LocationPreferenceStore; evaluate tracking viaTrackingEligibilityCheckerWritten by Cursor Bugbot for commit 9d30604. This will update automatically on new commits. Configure here.