Manos Chorianopoulos

add getCCMSLoyaltyCampaigns

...@@ -16,6 +16,7 @@ public struct GlobalVariables { ...@@ -16,6 +16,7 @@ public struct GlobalVariables {
16 static var couponList: Array<swiftApi.CouponItemModel> = [] 16 static var couponList: Array<swiftApi.CouponItemModel> = []
17 static var loyaltyBadge: swiftApi.LoyaltyBadgeModel = swiftApi.LoyaltyBadgeModel() 17 static var loyaltyBadge: swiftApi.LoyaltyBadgeModel = swiftApi.LoyaltyBadgeModel()
18 static var consumer: swiftApi.ProfileModel? 18 static var consumer: swiftApi.ProfileModel?
19 + static var ccmsCampaigns: Array<swiftApi.LoyaltyContextualOfferModel> = []
19 } 20 }
20 21
21 public class swiftApi { 22 public class swiftApi {
...@@ -79,6 +80,10 @@ public class swiftApi { ...@@ -79,6 +80,10 @@ public class swiftApi {
79 80
80 GlobalVariables.campaigns = GlobalVariables.campaigns.filter { $0.offer_category != "gifts_for_you" } + mergedGFYCampaigns 81 GlobalVariables.campaigns = GlobalVariables.campaigns.filter { $0.offer_category != "gifts_for_you" } + mergedGFYCampaigns
81 } 82 }
83 +
84 + public func getCCMSLoyaltyCampaigns() -> Array<LoyaltyContextualOfferModel> {
85 + return GlobalVariables.ccmsCampaigns
86 + }
82 87
83 public func getActiveDFYCoupons() -> Array<ActiveDFYCouponModel> { 88 public func getActiveDFYCoupons() -> Array<ActiveDFYCouponModel> {
84 return GlobalVariables.dfyCoupons 89 return GlobalVariables.dfyCoupons
...@@ -1352,7 +1357,7 @@ public class swiftApi { ...@@ -1352,7 +1357,7 @@ public class swiftApi {
1352 for item in GlobalVariables.campaigns { 1357 for item in GlobalVariables.campaigns {
1353 if (item.loyaltyCampaignId == campaign._loyaltyCampaignId) { 1358 if (item.loyaltyCampaignId == campaign._loyaltyCampaignId) {
1354 print("CCMS_PRESSED" + " " + campaign._id + " " + campaign._offerName) 1359 print("CCMS_PRESSED" + " " + campaign._id + " " + campaign._offerName)
1355 - 1360 +
1356 let instanceOfMyApi = MyApi() 1361 let instanceOfMyApi = MyApi()
1357 let campaignInfo = instanceOfMyApi.provideInfoForCampaign() 1362 let campaignInfo = instanceOfMyApi.provideInfoForCampaign()
1358 let finalUrl = (item.index_url ?? "") 1363 let finalUrl = (item.index_url ?? "")
......