0

上で動作しているときに位置更新を要求するPendingIntent()を使用して位置更新を要求する一般的な方法となっています。バックグラウンドでのアップデートを受け取るためにOデバイス上で実行されているアプリでこれを使用できますか?PendingIntent.getService(...)を使用してOデバイス

答えて

-1

[FusedLocationPRoviderApi#requestLocationUpdates]を呼び出すときPendingIntent.getService()又はPendingIntent.getBroadcast()のいずれかを使用してもよいNを標的以下(及びOまたは低級デバイス上で実行されている)アプリケーション(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

関連する問題