답변

-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()을 계속 사용할 수 있습니다.

+1

왜 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