Add the at_property Parameter to the Prefetch Request
Adobe Target Properties are defined in the Target interface and are used to establish boundaries for personalizing apps and websites. The at_property parameter identifies the specific property where your offers and activities are accessed and maintained. We’ll add a property to the prefetch and live location requests.
You can retrieve your at_property value in the Target interface under Setup > Properties. Hover over the property, select the code snippet icon and copy the at_property
value:
Add it as a parameter for each location in the prefetch request like this:
Here is the updated code for the targetPrefetchContent()
function (be sure to update the your at_property value goes here placeholder text!):
public void targetPrefetchContent() {
List<TargetPrefetchObject> prefetchList = new ArrayList<>();
Map<String, Object> params1;
params1 = new HashMap<String, Object>();
params1.put("at_property", "your at_property value goes here");
prefetchList.add(Target.createTargetPrefetchObject(Constant.wetravel_engage_home, params1));
prefetchList.add(Target.createTargetPrefetchObject(Constant.wetravel_engage_search, params1));
Target.TargetCallback<Boolean> prefetchStatusCallback = new Target.TargetCallback<Boolean>() {
@Override
public void call(final Boolean status) {
HomeActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
String cachingStatus = status ? "YES" : "NO";
System.out.println("Received Response from prefetch : " + cachingStatus);
engageMessage();
setUp();
}
});
}};
Target.prefetchContent(prefetchList, null, prefetchStatusCallback);
}