【发布时间】:2022-01-24 04:24:20
【问题描述】:
使用前台服务时位置权限 ALWAYS_ALLOW 和 Only While Using the App 选项之间有什么区别。我正在开发一个始终使用位置权限的 SDK,我正在使用前台服务,可以允许“仅在使用应用程序时”权限而不是 ALWAYS_ALLOW
【问题讨论】:
标签: java android sdk android-permissions foreground-service
使用前台服务时位置权限 ALWAYS_ALLOW 和 Only While Using the App 选项之间有什么区别。我正在开发一个始终使用位置权限的 SDK,我正在使用前台服务,可以允许“仅在使用应用程序时”权限而不是 ALWAYS_ALLOW
【问题讨论】:
标签: java android sdk android-permissions foreground-service
使用Only While Using the App选项没有问题,如果应用程序中的位置获取过程只会在应用程序在屏幕上打开时执行。
如果你想在后台获取位置,你应该使用 ALWAYS_ALLOW 选项。
【讨论】: