Region

Package: com.salesforce.marketingcloud.pushmodels

Module: Push Models Module v1.0.2

SDK: Salesforce Marketing Cloud Unified SDK 11.0.0

Region is a data class representing a geographic or beacon region in the Salesforce Marketing Cloud SDK. It provides functionality for managing both geofence regions and proximity beacon regions.

  • Implements Parcelable - Enables Android inter-component communication
  • Implements Comparable<Region> - Allows sorting and comparison operations

As a data class, Region has a primary constructor with the following parameters:

All properties are annotated with @JvmField for direct field access from Java:

PropertyTypeDescription
centerLatLonThe geographic center coordinates of the region
descriptionString?Optional textual description of the region
idStringUnique identifier for the region
majorIntMajor value (typically used for beacon regions)
messagesList<Message>Collection of messages associated with this region
minorIntMinor value (typically used for beacon regions)
nameString?Optional display name for the region
proximityUuidString?Optional UUID for proximity beacons
radiusIntThe radius of the region (in meters for geofences)
regionTypeIntNumeric type identifier for the region (see Companion constants)

Converts the Region object to its JSON representation.

Returns: JSONObject containing the region data

The Region.Companion object provides constants and factory methods for working with Region instances.

Constant representing a fence-type region (geofence).

Constant representing a proximity-type region (beacon).

Creates a Region object from a JSONObject.

Parameters:

  • jsonObject - A nullable JSONObject containing region data

Returns: A nullable Region instance, or null if creation fails

Annotations: @JvmStatic - Makes this function accessible as a static method from Java

  • LatLon - Represents geographic coordinates (latitude/longitude)
  • Message - Represents messages associated with a region