WZWren / night-sentry

0 stars 0 forks source link

Background Location Services cannot be used for Widgets #10

Closed WZWren closed 1 year ago

WZWren commented 1 year ago

Starting from Android 10/11, apps that require Background Location Permissions need to explicitly undergo review by Google Play. (https://support.google.com/googleplay/android-developer/answer/9799150#Does%20your%20app%20need%20access%20to%20location%20in%20the%20background) Since location handling for widgets in React Native need to be handled by a background location task, we are unable to implement current location handling without submitting this app for review. As we are nearing the deadline for the app, and the review process for this app also requires additional work, including a video demonstration, we have deemed it to be not worth the time investment for an app ultimately used as a learning platform.

Solution

To make sure the location field is always field when pushing an alert, we will be using the lastKnownLocation method to push a location to the server. We note the downsides of using such a solution, especially for an emergency alert application like this. However, this is the best alternative to make a widget function work. The scrapped code for the proposed task implementation will be included in the widget-task-handler file currently on the widget branch.