...
There are 9 types of in-app messages:
Pop-up - Image, Header, Text & Button | Mini-icon&text | Full Screen-image |
---|---|---|
Full Screen-image&button | Pop-up - Image, Header, Text & Button | Pop-up-Survey |
Pop-up - NPS with Text & Button | Native Alert & Action Sheet | NPS with Numbers |
NPS & Second Popup |
Video In-App | ||
...
ZoneID is different for each application, so contact RMC team for support. Suggestion widgets such as "Alternative Products" require the product code to be seen as a parameter.
The specification of After the request is completed, the callback function is as followscalled depending on the success or failure of the request, so you need to code the callback functions according to your needs as shown below:
Code Block | ||
---|---|---|
|
...
VisilabsTargetRequest targetRequest = Visilabs.CallAPI().buildTargetRequest(zoneID, "productCode");
targetRequest.executeAsync(callback);
...
language | java |
---|
...
VisilabsCallback callback = new |
...
VisilabsCallback() |
...
|
...
{ |
...
|
...
|
...
|
...
After the request is completed, the callback function is called depending on the success or failure of the request, so you need to code the callback functions according to your needs as shown below:
...
language | java |
---|
...
@Override public void success(VisilabsResponse response) { try{ JSONObject jsonObject = response.getJson(); String groupTitle = jsonObject.getString("title"); JSONArray jsonArray = jsonObject.getJSONArray("recommendations"); for(int i = 0 ; i < |
...
jsonArray.length() ; i++) { JSONObject |
...
currentProductObject = |
...
jsonArray.getJSONObject(i); |
...
String currentProductTitle = currentProductObject.getString(" |
...
title") |
...
;
Double currentProductPrice = currentProductObject.getDouble("price");
boolean currentProductFreeShipping = currentProductObject.getBoolean("freeshipping");
String qs = currentProductObject.getString("qs");
//Continues like this...
}
} catch (Exception e){
Log.e(LOG_TAG, e.getMessage(), e);
}
}
@Override
public void fail(VisilabsResponse response) {
Log.e(LOG_TAG, response.getErrorMessage());
}
}; |
After creating the callback function as above, the request is thrown as follows:
Code Block | ||
---|---|---|
| ||
VisilabsTargetRequest targetRequest = Visilabs.CallAPI().buildTargetRequest(zoneID, "productCode");
targetRequest.executeAsync(callback); |
There is also an overload buildTargetRequest method where you can pass filters and additional parameters.
Code Block | ||
---|---|---|
| ||
List<VisilabsTargetFilter> filters = new ArrayList<VisilabsTargetFilter>();
HashMap<String,String> properties = new HashMap<String, String>();
properties.put("OM.extra", "Extra Value");
VisilabsTargetFilter f = new VisilabsTargetFilter("attr1", "0", "value");
filters.add(f);
f.setAttribute("attr2");
f.setFilterType("1"); // There are 2 filter types: Include and Exclude. For Include pass "0", for Exclude pass "1".
f.setValue("value");
filters.add(f);
try {
VisilabsTargetRequest targetRequest = Visilabs.CallAPI().buildTargetRequest(zoneID, "productCode", properties, filters);
targetRequest.executeAsync(callback);
} catch (Exception e) {
e.printStackTrace(); |
In order for Recommendation clicks to be reflected on the panel, the following method should be called with the "qs" parameter of the clicked product.
Code Block |
---|
// In the example callback function, you can see how the "qs" parameter can be obtained for each product.
Visilabs.CallAPI().trackRecommendationClick(qs); |
...
Code Block | ||
---|---|---|
| ||
customEvent(String pageName, HashMap<String, String> properties, Activity parent) |
Spin to Win Full | Spin to Win Half |
---|---|
Scratch to Win
After form is created at RMC panel, likewise in-app message, existence of Scratch to Win is controlled by after each customEvent
call. It is shown as follows. You need to call overload, which takes Activity in the customEvent parameter. Sample code and visual;
Code Block | ||
---|---|---|
| ||
customEvent(String pageName, HashMap<String, String> properties, Activity parent) |
...
Product Stat Notifier
The Product Stat Notifier action that you define in the RMC Panel works in Product View, Add to Cart and Add/Remove Favorites events. When you send these events, you must make sure that the product id is sent. The customEvent method you call in these events should take the Activity overload.
...
Drawer
After a drawer action is created at RMC panel, likewise in-app message, existence of a Drawer action is controlled after each customEvent
call. You need to call the method with Activity parameter. Sample code and visual;
Code Block |
---|
customEvent(String pageName, HashMap<String, String> properties, Activity parent) |
...