monodroid-samples icon indicating copy to clipboard operation
monodroid-samples copied to clipboard

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

Open Rob-Houweling opened this issue 7 years ago • 2 comments

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.

Rob-Houweling avatar Oct 13 '17 11:10 Rob-Houweling

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

gonzalonm avatar Oct 13 '17 13:10 gonzalonm

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

gonzalonm avatar Oct 13 '17 14:10 gonzalonm