Manos Chorianopoulos

add more campaign url logs

......@@ -84,10 +84,20 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
var url = ""
let isCcmsOffer = (campaigns[indexPath.row].ccms_offer != nil) && (campaigns[indexPath.row].ccms_offer != "") && (campaigns[indexPath.row].ccms_offer == "true")
// TODO: DELETE
print("isCcmsOffer: " + (isCcmsOffer ? "true" : "false"))
if (isCcmsOffer) {
let ccmsCampaigns = swiftApi().getCCMSLoyaltyCampaigns()
// TODO: DELETE
print("ccmsCampaigns count: " + String(ccmsCampaigns.count))
let loyaltyCampaignIdExists = ccmsCampaigns.contains { $0._loyaltyCampaignId == campaigns[indexPath.row].session_uuid }
// TODO: DELETE
print("loyaltyCampaignIdExists: " + (loyaltyCampaignIdExists ? "true" : "false"))
if (loyaltyCampaignIdExists == true) {
var ccmsCampaignFound:swiftApi.LoyaltyContextualOfferModel = swiftApi.LoyaltyContextualOfferModel()
for item in ccmsCampaigns {
......@@ -96,8 +106,15 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
}
}
url = swiftApi().constructCcmsUrl(campaigns[indexPath.row], ccmsCampaignFound)
// TODO: DELETE
print("ccmsCampaignFound: " + ccmsCampaignFound._loyaltyCampaignId)
} else {
url = swiftApi().constructCampaignUrl(campaigns[indexPath.row])
// TODO: DELETE
print("loyaltyCampaignId DOESNT Exist")
}
} else {
......
......@@ -1537,9 +1537,13 @@ public class swiftApi {
}
public func constructCcmsUrl(_ campaign: LoyaltyContextualOfferModel) -> String {
// TODO: DELETE
print("======== constructCcmsUrl 1 arg ========")
for item in GlobalVariables.campaigns {
if (item.session_uuid == campaign._loyaltyCampaignId) {
print("CCMS_PRESSED" + " " + campaign._id + " " + campaign._offerName)
// TODO: DELETE
print("campaign matched: " + " " + item.session_uuid + " ccms matched: " + campaign._loyaltyCampaignId)
var assetsString = ""
if (campaign._eligibleAssets != nil && campaign._eligibleAssets.count > 0) {
......@@ -1591,10 +1595,14 @@ public class swiftApi {
}
}
print("constructCcmsUrl url: " + "")
// TODO: DELETE
print("======== constructCcmsUrl 1 arg: ccms not matched ========")
return ""
}
public func constructCcmsUrl(_ campaign: CampaignItemModel, _ ccmsCampaign: LoyaltyContextualOfferModel) -> String {
// TODO: DELETE
print("======== constructCcmsUrl 2 args ========")
print("CCMS_PRESSED" + " " + ccmsCampaign._id + " " + ccmsCampaign._offerName)
var assetsString = ""
......