diff --git a/mobile-engage/src/androidTest/java/com/emarsys/mobileengage/geofence/DefaultGeofenceInternalTest.kt b/mobile-engage/src/androidTest/java/com/emarsys/mobileengage/geofence/DefaultGeofenceInternalTest.kt index 9edd855e..209b00d8 100644 --- a/mobile-engage/src/androidTest/java/com/emarsys/mobileengage/geofence/DefaultGeofenceInternalTest.kt +++ b/mobile-engage/src/androidTest/java/com/emarsys/mobileengage/geofence/DefaultGeofenceInternalTest.kt @@ -448,6 +448,7 @@ class DefaultGeofenceInternalTest { geofenceInternal.setInitialEnterTriggerEnabled(true) geofenceInternal.registerGeofences(nearestGeofencesWithoutRefreshArea + refreshArea) + verify(mockInitialEnterTriggerEnabledStorage).set(true) argumentCaptor().apply { verify(mockGeofencingClient).addGeofences(capture(), any()) diff --git a/mobile-engage/src/main/java/com/emarsys/mobileengage/geofence/DefaultGeofenceInternal.kt b/mobile-engage/src/main/java/com/emarsys/mobileengage/geofence/DefaultGeofenceInternal.kt index 530d91d6..d8999697 100644 --- a/mobile-engage/src/main/java/com/emarsys/mobileengage/geofence/DefaultGeofenceInternal.kt +++ b/mobile-engage/src/main/java/com/emarsys/mobileengage/geofence/DefaultGeofenceInternal.kt @@ -51,7 +51,7 @@ class DefaultGeofenceInternal(private val requestModelFactory: MobileEngageReque private val geofencePendingIntentProvider: GeofencePendingIntentProvider, coreSdkHandler: CoreSdkHandler, private val uiHandler: Handler, - initialEnterTriggerEnabledStorage: Storage + private val initialEnterTriggerEnabledStorage: Storage ) : GeofenceInternal, LocationListener { private companion object { const val FASTEST_INTERNAL: Long = 15_000 @@ -272,6 +272,7 @@ class DefaultGeofenceInternal(private val requestModelFactory: MobileEngageReque override fun setInitialEnterTriggerEnabled(enabled: Boolean) { this.initialEnterTriggerEnabled = enabled + initialEnterTriggerEnabledStorage.set(enabled) } private fun createActionsFromTriggers(geofence: MEGeofence, triggerType: TriggerType): List {