dotnet / android-samples

A collection of .NET for Android sample projects
https://dotnet.microsoft.com/apps/mobile
MIT License
2.21k stars 4.05k forks source link

No use of mGeofencePendingIntent in google-services / Location /geofencing example? #223

Closed Rob-Houweling closed 2 months ago

Rob-Houweling commented 6 years ago

Please correct me if I'm wrong, but as far as I can tell there is no use of the var mGeofencePendingIntent in the MainActivity.cs

It is being created, set to null in OnCreated (while it is null) and there's a check in GetGeoforcePendingIntent: if (mGeofencePendingIntent != null) { return mGeofencePendingIntent; } It is not set anywhere. I assume it should be set with the value of the PendingIntent.GetService which is returned in the GetGeofencePendingIntent.

gonzalonm commented 6 years ago

Related sample: https://github.com/xamarin/monodroid-samples/tree/master/google-services/Location/Geofencing

gonzalonm commented 6 years ago

Similar case with google sample: https://github.com/googlesamples/android-play-location/blob/master/Geofencing/app/src/main/java/com/google/android/gms/location/sample/geofencing/MainActivity.java#L230

I think it left when this sample was deprecated here: https://github.com/googlesamples/android-Geofencing/blob/master/Application/src/main/java/com/example/android/wearable/geofencing/MainActivity.java#L153

Anyways, this could be assigned when PendingIntent is generated instead of return it every time (as you assumed). We'll keep it in mind in future updates.

Thanks