register Geofences With Google Play If Necessary
fun registerGeofencesWithGooglePlayIfNecessary(context: Context, desiredGeofencesToRegister: List<BrazeGeofence>, geofenceRequestIntent: PendingIntent, removalFunction: (List<String>) -> Unit = { removeGeofencesRegisteredWithGeofencingClient(context, it) }, registerFunction: (List<BrazeGeofence>) -> Unit = { registerGeofencesWithGeofencingClient(context, it, geofenceRequestIntent) })
Requests to register the given list of geofences with Google Play Location Services.
If a given geofence is already registered with Google Play Location Services, it will not be needlessly re-registered. Geofences that are registered with Google Play Location Services but not included in desiredGeofencesToRegister will be un-registered.
If desiredGeofencesToRegister is empty, all geofences will be un-registered and deleted from local storage.
Parameters
context
used by shared preferences
desired Geofences To Register
list of BrazeGeofence objects to register if new or updated. Otherwise ignored.
geofence Request Intent
pending intent to fire when geofences transition events occur.
removal Function
function to remove geofences from Google Play Location Services.
register Function
function to register geofences with Google Play Location Services.