PendingIntent.getService (...)를 사용하여 위치 업데이트를 요청하는 일반적인 방법이 있습니다. O 장치에서 실행중인 앱에서 백그라운드 위치 업데이트를 수신하는 데 여전히이 기능을 사용할 수 있습니까?O 디바이스에서 실행할 때 PendingIntent()를 사용하여 위치 업데이트를 요청하십시오.
0
A
답변
-1
애플리케이션 타겟팅 N 이하 (및 O 또는 하단의 장치에서 실행)는 하나 또는 PendingIntent.getService()
PendingIntent.getBroadcast()
호출 [FusedLocationPRoviderApi # requestLocationUpdates (https://developers.google.com/android/reference/com/google/android/gms/location/FusedLocationProviderApi.html#requestLocationUpdates(com.google.android.gms.common.api.GoogleApiClient, com.google.android.gms.location.LocationRequest, android.app를 사용할 수도 .PendingIntent)).
O를 타겟팅하는 앱은 백그라운드에서 위치 업데이트를 계속 받으려면 PendingIntent.getBroadcast()
(및 BroadcastReceiver
을 정의하고이를 매니페스트에 등록해야 함) 만 사용해야합니다. O를 타겟팅하는 앱이 subject to limits on services started in the background이기 때문입니다.
O 타겟팅 앱은 포 그라운드에서 위치 업데이트를 수신하기 만하면 PendingIntent.getService()
을 계속 사용할 수 있습니다.
왜 Android O를 타겟팅하는 앱은 PendingIntent.getBroadcast() 만 사용해야한다고 생각하십니까? 문서에서 PendingIntent.getService()를 사용한다고 말합니다. https://developers.google.com/android/reference/com/google/android/gms/location/FusedLocationProviderApi.html#requestLocationUpdates(com.google.android.gms.common) .api.GoogleApiClient, com.google.android.gms.location.LocationRequest, android.app.PendingIntent) – NinjaCoder