Data Integration
Call to Action
Video Apps
6min
view item when the user needs to be taken to the detail/view page of a video content the app should handle the edge cases for example invalid item id if the user is not allowed to go to the videos detail page (maybe because the user is not logged in) properties key value description actiontype view item type of action to be performed item item docid\ xyfflvav fzf01nmc2zn the object of the item which holds itemid, name it is similar to an item sent via view item docid 3azoy3cgtezkrgmnm9jl5 event or via cms code example function oncooeectalistener(payload) { if (!payload) { return; } if (payload get("actiontype") == "view item") { const item = payload get("item"); // show given item to the user } } ts function oncooeectalistener(payload) { if (!payload) { return; } if (payload\["actiontype"] == "view item") { const item = payload\["item"]; // show given item to the user } }void oncooeectalistener(hashmap\<string, object> payload) { if (payload == null) { return; } if (payload get("actiontype") == "view item") { map\<string,object> item = (map\<string,object>) payload get("item"); // show given item to the user } }fun oncooeectalistener(payload hashmap\<string, any>) { if (payload == null) { return; } if (payload\["actiontype"] == "view item") { val item = payload\["item"] as map\<string, any>; // show given item to the user } } (void) oncooeectaresponsewithpayload (nsdictionary\<nsstring ,id> )payload { if (payload count == 0) { return; } if (\[payload\[@"actiontype"] isequal @"view item"]) { nsdictionary item = payload\[@"item"]; // show given item to the user } }func oncooeectalistener(payload \[string any]) { if (payload isempty) { return } if (payload\["actiontype"] == "view item") { let item = payload\["item"] as \[string any] // show given item to the user } } dart void inapptriggered(map\<string, dynamic> payload) { if(payload == null) { return; } if (map\["actiontype"] == "view item") { var item = payload\["item"]; // show given item to the user } } } play item when a particular video needs to be played users should be first taken to the view page of the content (if available) app should handle edge cases for example the user is allowed to play the content wrong content/item id properties key value description actiontype play item type of action to be performed item item docid\ xyfflvav fzf01nmc2zn the object of the item which holds itemid, name it is similar to an item sent via view item docid 3azoy3cgtezkrgmnm9jl5 event or via cms time number seconds from where video should start code example function oncooeectalistener(payload) { if (!payload) { return; } if (payload get("actiontype") == "play item") { const item = payload get("item"); const seconds = payload get("time"); // play given item for user starting from given seconds } } ts function oncooeectalistener(payload) { if (!payload) { return; } if (payload\["actiontype"] == "play item") { const item = payload\["item"]; const seconds = payload\["time"]; // play given item for user starting from given seconds } }void oncooeectalistener(hashmap\<string, object> payload) { if (payload == null) { return; } if (payload get("actiontype") == "play item") { map\<string,object> item = (map\<string,object>) payload get("item"); integer seconds = (integer) payload get("time"); // play given item for user starting from given seconds } }fun oncooeectalistener(payload hashmap\<string, any>) { if (payload == null) { return; } if (payload\["actiontype"] == "play item") { val item = payload\["item"] as map\<string, any>; val seconds = payload\["item"] as? int; // play given item for user starting from given seconds } } (void) oncooeectaresponsewithpayload (nsdictionary\<nsstring ,id> )payload { if (payload count == 0) { return; } if (\[payload\[@"actiontype"] isequal @"play item"]) { nsdictionary item = payload\[@"item"]; nsinteger seconds = payload\[@"item"]; // play given item for user starting from given seconds } }func oncooeectalistener(payload \[string any]) { if (payload isempty) { return } if (payload\["actiontype"] == "play item") { let item = payload\["item"] as \[string any] let seconds = payload\["time"] as? int // play given item for user starting from given seconds } } dart void inapptriggered(map\<string, dynamic> payload) { if(payload == null) { return; } if (map\["actiontype"] == "play item") { var item = payload\["item"]; var seconds = payload\["time"]; // play given item for user starting from given seconds } } }