Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ACCESS_COARSE_LOCATION permission #1949

Merged
merged 2 commits into from
Dec 28, 2023

Conversation

shepherd-l
Copy link
Contributor

@shepherd-l shepherd-l commented Dec 19, 2023

Description

One Line Summary

Removes ACCESS_COARSE_LOCATION from the location module

Details

Motivation

Fixes

This change was made to avoid the location permission requirement for those who use the com.onesignal:OneSignal package like our wrapper SDKs and do not use location with OneSignal.

Scope

Requires developers to add ACCESS_COARSE_LOCATION to their AndroidManifest themselves if they would like to use OneSignal location. This change reverts back to the player model behaviour.

Testing

Manual testing

Tested calling location request permission with location sharing on, app build with Android Studio 2022.1.1 of the OneSignal example app on an emulated Pixel 4 with Android 12.

Calling OneSignal.Location.requestPermission() without ACCESS_COARSE_LOCATION(or other location permissions) logs and does not crash the app.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • 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
    • If it is hard to explain how any codes changes are related to each other then it most likely needs to be more than one PR
  • 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.
    • Simplify with less code, followed by splitting up code into well named functions and variables, followed by adding comments to the code.
  • I have reviewed this PR myself, ensuring it meets each checklist item
    • WIP (Work In Progress) is ok, but explain what is still in progress and what you would like feedback on. Start the PR title with "WIP" to indicate this.

This change is Reviewable

@shepherd-l shepherd-l requested a review from nan-li December 27, 2023 20:39
@shepherd-l shepherd-l force-pushed the removeAccessCoarseLocation branch from f3e874d to 8874b71 Compare December 28, 2023 19:44
@shepherd-l shepherd-l force-pushed the removeAccessCoarseLocation branch from 8874b71 to a2564f8 Compare December 28, 2023 20:06
Require developers to add ACCESS_COARSE_LOCATION to their AndroidManifest themselves. This is done to avoid the location permission requirement for those who use the com.onesignal:OneSignal package like our wrapper SDKs. This change reverts back to the player model behaviour
Make it clear that developers have to add the access location permission to their AndroidManifest for the location module to work
@shepherd-l shepherd-l force-pushed the removeAccessCoarseLocation branch from a2564f8 to 230980a Compare December 28, 2023 20:30
@shepherd-l shepherd-l merged commit 5796b70 into user-model/main Dec 28, 2023
2 checks passed
@shepherd-l shepherd-l deleted the removeAccessCoarseLocation branch December 28, 2023 20:51
@jennantilla jennantilla mentioned this pull request Dec 28, 2023
jinliu9508 pushed a commit that referenced this pull request Jan 31, 2024
jinliu9508 pushed a commit that referenced this pull request Jan 31, 2024
jinliu9508 pushed a commit that referenced this pull request Feb 6, 2024
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