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:
| Property | Type | Description |
|---|---|---|
center | LatLon | The geographic center coordinates of the region |
description | String? | Optional textual description of the region |
id | String | Unique identifier for the region |
major | Int | Major value (typically used for beacon regions) |
messages | List<Message> | Collection of messages associated with this region |
minor | Int | Minor value (typically used for beacon regions) |
name | String? | Optional display name for the region |
proximityUuid | String? | Optional UUID for proximity beacons |
radius | Int | The radius of the region (in meters for geofences) |
regionType | Int | Numeric 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 nullableJSONObjectcontaining 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