Surface
The Surface class represents an entity for user or system interaction. It is identified by a self-describing URI which is used to fetch the decision propositions from the AJO campaigns. For example, all mobile application surface URIs start with mobileapp://, followed by app bundle identifier and an optional path.
iOS Interface - Surface
Surface class is used to create surface instances for requesting propositions in personalization query requests.
Public variables
uri
Unique surface URI string.
public let uri: String
Public functions
init
Creates a new surface by appending the given surface path to the mobile app surface prefix.
- path is a string representation for the surface path.
iOS Swift
data-slots=heading, code
data-repeat=2
Syntax
public init(path: String)
Example
// Creates a surface instance representing a banner within homeView view in my mobile application.
let surface = Surface(path: "homeView#banner")
Android Interface - Surface
Surface class is used to create surface objects for requesting propositions in personalization query requests.
Public functions
Parameterized Constructor
Creates a new surface by appending the given surface path to the mobile app surface prefix.
- path is a string containing the surface path.
Android Java
data-slots=heading, code
data-repeat=2
Syntax
public Surface(final String path)
Example
// Creates a surface instance representing a banner view within homeActivity in my mobile application.
final Surface surface = new Surface("homeActivity#banner")
Android Kotlin
data-slots=heading, code
data-repeat=1
Example
// Creates a surface instance representing a banner view within homeActivity in my mobile application.
val surface = Surface("homeActivity#banner")
Default Constructor
Creates a new base surface by appending application package name to the mobile app surface prefix mobileapp://.
Android Java
data-slots=heading, code
data-repeat=2
Syntax
public Surface()
Example
// Creates a new base surface by appending application package name to the mobile app surface prefix mobileapp://
final Surface surface = new Surface()
Android Kotlin
data-slots=heading, code
data-repeat=1
Example
// Creates a new base surface by appending application package name to the mobile app surface prefix mobileapp://
val surface = Surface()
getUri
Returns this surface's URI as a string.
Android Java
data-slots=heading, code
data-repeat=2
Syntax
public String getUri()
Example
final Surface surface = new Surface("homeActivity#banner")
final String uri = surface.getUri()
Android Kotlin
data-slots=heading, code
data-repeat=1
Example
val surface = Surface("homeActivity#banner")
val uri = surface.uri