Skip to content

Commit 6820128

Browse files
mrehan27claude
andauthored
fix: gate iOS geofence enablement on a dictionary config (#621)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ead1d9c commit 6820128

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

ios/wrappers/NativeCustomerIO.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ public class NativeCustomerIO: NSObject {
5353
// config is provided or geofence is enabled, since geofence relies on the
5454
// location module's fixes.
5555
#if CIO_GEOFENCE_ENABLED
56-
let geofenceConfigured = config["geofence"] != nil
56+
// Match NativeGeofence.module(from:): only a dictionary counts as configured,
57+
// so a non-map value (e.g. null bridged from JS) doesn't imply location.
58+
let geofenceConfigured = config["geofence"] as? [String: Any] != nil
5759
#else
5860
let geofenceConfigured = false
5961
#endif
@@ -71,7 +73,9 @@ public class NativeCustomerIO: NSObject {
7173

7274
// Customer value wins; default on when the geofence module is added, off otherwise.
7375
#if CIO_GEOFENCE_ENABLED
74-
let geofenceAdded = config["geofence"] != nil
76+
// Match NativeGeofence.module(from:): only a dictionary adds the module, so
77+
// background delivery shouldn't default on for a non-map geofence value.
78+
let geofenceAdded = config["geofence"] as? [String: Any] != nil
7579
#else
7680
let geofenceAdded = false
7781
#endif

0 commit comments

Comments
 (0)