Manos Chorianopoulos

add more campaign url logs

...@@ -84,10 +84,20 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{ ...@@ -84,10 +84,20 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
84 var url = "" 84 var url = ""
85 let isCcmsOffer = (campaigns[indexPath.row].ccms_offer != nil) && (campaigns[indexPath.row].ccms_offer != "") && (campaigns[indexPath.row].ccms_offer == "true") 85 let isCcmsOffer = (campaigns[indexPath.row].ccms_offer != nil) && (campaigns[indexPath.row].ccms_offer != "") && (campaigns[indexPath.row].ccms_offer == "true")
86 86
87 + // TODO: DELETE
88 + print("isCcmsOffer: " + (isCcmsOffer ? "true" : "false"))
89 +
87 if (isCcmsOffer) { 90 if (isCcmsOffer) {
88 let ccmsCampaigns = swiftApi().getCCMSLoyaltyCampaigns() 91 let ccmsCampaigns = swiftApi().getCCMSLoyaltyCampaigns()
92 +
93 + // TODO: DELETE
94 + print("ccmsCampaigns count: " + String(ccmsCampaigns.count))
95 +
89 let loyaltyCampaignIdExists = ccmsCampaigns.contains { $0._loyaltyCampaignId == campaigns[indexPath.row].session_uuid } 96 let loyaltyCampaignIdExists = ccmsCampaigns.contains { $0._loyaltyCampaignId == campaigns[indexPath.row].session_uuid }
90 97
98 + // TODO: DELETE
99 + print("loyaltyCampaignIdExists: " + (loyaltyCampaignIdExists ? "true" : "false"))
100 +
91 if (loyaltyCampaignIdExists == true) { 101 if (loyaltyCampaignIdExists == true) {
92 var ccmsCampaignFound:swiftApi.LoyaltyContextualOfferModel = swiftApi.LoyaltyContextualOfferModel() 102 var ccmsCampaignFound:swiftApi.LoyaltyContextualOfferModel = swiftApi.LoyaltyContextualOfferModel()
93 for item in ccmsCampaigns { 103 for item in ccmsCampaigns {
...@@ -96,8 +106,15 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{ ...@@ -96,8 +106,15 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
96 } 106 }
97 } 107 }
98 url = swiftApi().constructCcmsUrl(campaigns[indexPath.row], ccmsCampaignFound) 108 url = swiftApi().constructCcmsUrl(campaigns[indexPath.row], ccmsCampaignFound)
109 +
110 + // TODO: DELETE
111 + print("ccmsCampaignFound: " + ccmsCampaignFound._loyaltyCampaignId)
112 +
99 } else { 113 } else {
100 url = swiftApi().constructCampaignUrl(campaigns[indexPath.row]) 114 url = swiftApi().constructCampaignUrl(campaigns[indexPath.row])
115 +
116 + // TODO: DELETE
117 + print("loyaltyCampaignId DOESNT Exist")
101 } 118 }
102 119
103 } else { 120 } else {
......
...@@ -1537,9 +1537,13 @@ public class swiftApi { ...@@ -1537,9 +1537,13 @@ public class swiftApi {
1537 } 1537 }
1538 1538
1539 public func constructCcmsUrl(_ campaign: LoyaltyContextualOfferModel) -> String { 1539 public func constructCcmsUrl(_ campaign: LoyaltyContextualOfferModel) -> String {
1540 + // TODO: DELETE
1541 + print("======== constructCcmsUrl 1 arg ========")
1540 for item in GlobalVariables.campaigns { 1542 for item in GlobalVariables.campaigns {
1541 if (item.session_uuid == campaign._loyaltyCampaignId) { 1543 if (item.session_uuid == campaign._loyaltyCampaignId) {
1542 print("CCMS_PRESSED" + " " + campaign._id + " " + campaign._offerName) 1544 print("CCMS_PRESSED" + " " + campaign._id + " " + campaign._offerName)
1545 + // TODO: DELETE
1546 + print("campaign matched: " + " " + item.session_uuid + " ccms matched: " + campaign._loyaltyCampaignId)
1543 1547
1544 var assetsString = "" 1548 var assetsString = ""
1545 if (campaign._eligibleAssets != nil && campaign._eligibleAssets.count > 0) { 1549 if (campaign._eligibleAssets != nil && campaign._eligibleAssets.count > 0) {
...@@ -1591,10 +1595,14 @@ public class swiftApi { ...@@ -1591,10 +1595,14 @@ public class swiftApi {
1591 } 1595 }
1592 } 1596 }
1593 print("constructCcmsUrl url: " + "") 1597 print("constructCcmsUrl url: " + "")
1598 + // TODO: DELETE
1599 + print("======== constructCcmsUrl 1 arg: ccms not matched ========")
1594 return "" 1600 return ""
1595 } 1601 }
1596 1602
1597 public func constructCcmsUrl(_ campaign: CampaignItemModel, _ ccmsCampaign: LoyaltyContextualOfferModel) -> String { 1603 public func constructCcmsUrl(_ campaign: CampaignItemModel, _ ccmsCampaign: LoyaltyContextualOfferModel) -> String {
1604 + // TODO: DELETE
1605 + print("======== constructCcmsUrl 2 args ========")
1598 print("CCMS_PRESSED" + " " + ccmsCampaign._id + " " + ccmsCampaign._offerName) 1606 print("CCMS_PRESSED" + " " + ccmsCampaign._id + " " + ccmsCampaign._offerName)
1599 1607
1600 var assetsString = "" 1608 var assetsString = ""
......