registerGeofencesWithGooglePlayIfNecessary

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

desiredGeofencesToRegister

list of BrazeGeofence objects to register if new or updated. Otherwise ignored.

geofenceRequestIntent

pending intent to fire when geofences transition events occur.

removalFunction

function to remove geofences from Google Play Location Services.

registerFunction

function to register geofences with Google Play Location Services.