java.lang.Object | |
↳ | com.usebutton.sdk.PlacementContext |
Convenience class on top of JSONObject. Mutable key-value pairs with promotion relevant information.
See ButtonDropin
for a full example of a location aware context.
Context parameters provided to promotions.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new PlacementContext object with a location, this can be used for transportation
promotions to indicate the drop off location.
| |||||||||||
Creates a new PlacementContext object with a location, this can be used for transportation
promotions to indicate the pick up location.
| |||||||||||
Reserved for future proofing the SDK so new top level keys can be used by partners without
SDK changes.
| |||||||||||
Add a String
value to the context for key name , This will be added under
the vendor top-level key. | |||||||||||
Add an arbitrary org.json.JSONObject
value to the context for key name . | |||||||||||
Adds a named end location to this promotion context.
| |||||||||||
Add a start time to the context, for example the end of a trip.
| |||||||||||
Adds a start location to context.
| |||||||||||
Adds a start location to context.
| |||||||||||
Add a start time to the context, for example the start of a trip.
| |||||||||||
Add a location representing the object the user is looking at, for a restaurant listing, it
would be the location of the restaurant.
| |||||||||||
Add the user's location to the context, for example for interesting venues around the user.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Creates a new PlacementContext object with a location, this can be used for transportation
promotions to indicate the drop off location.
Equivalent to new PlacementContext().withEndLocation(...);
.
locationName | for example "Pizza Restaurant" |
---|
Creates a new PlacementContext object with a location, this can be used for transportation
promotions to indicate the pick up location.
Equivalent to new PlacementContext().withStartLocation(...);
.
locationName | for example "Work" |
---|
Reserved for future proofing the SDK so new top level keys can be used by partners without SDK changes. You are probably looking for #putVendorValue(String, Object).
Add a String value
to the context for key name
, This will be added under
the vendor top-level key. {"vendor": {:name: :value
}
Add an arbitrary org.json.JSONObject value
to the context for key name
. This will be added under
the vendor top-level key. {"vendor": {:name: :value
}
Adds a named end location to this promotion context.
Add a start time to the context, for example the end of a trip.
Adds a start location to context.
name | of start location, for example "Office" |
---|
Adds a start location to context.
Add a start time to the context, for example the start of a trip.
Add a location representing the object the user is looking at, for a restaurant listing, it would be the location of the restaurant. For a travel app, it would be the location of the destination.
Add the user's location to the context, for example for interesting venues around the user.