Showing
2 changed files
with
10 additions
and
6 deletions
... | @@ -198,20 +198,24 @@ var timer2: DispatchSourceTimer? | ... | @@ -198,20 +198,24 @@ var timer2: DispatchSourceTimer? |
198 | SwiftEventBus.post("coupon_retrieved", sender: couponEvent) | 198 | SwiftEventBus.post("coupon_retrieved", sender: couponEvent) |
199 | 199 | ||
200 | swiftApi().getCouponsAsync(getCouponsCallback) | 200 | swiftApi().getCouponsAsync(getCouponsCallback) |
201 | + swiftApi().getCampaignsAsyncNew(language: "en", filters: [String : Any](), getCampaignsCallback) | ||
201 | 202 | ||
202 | func getCouponsCallback (_ couponsData: Array<swiftApi.CouponItemModel>?) -> Void { | 203 | func getCouponsCallback (_ couponsData: Array<swiftApi.CouponItemModel>?) -> Void { |
203 | if (couponsData != nil) { | 204 | if (couponsData != nil) { |
204 | 205 | ||
205 | DispatchQueue.main.async { | 206 | DispatchQueue.main.async { |
206 | SwiftEventBus.post("coupons_fetched") | 207 | SwiftEventBus.post("coupons_fetched") |
208 | + } | ||
209 | + } else { | ||
210 | + } | ||
211 | + } | ||
207 | 212 | ||
208 | - // print("========= getCouponsRequest SUCCESSSS CampaignVC =========") | 213 | + func getCampaignsCallback (_ campaignsData: Array<swiftApi.CampaignItemModel>?) -> Void { |
209 | - | 214 | + if (campaignsData != nil) { |
210 | - // print("========= getCouponsRequest count CampaignVC =========") | 215 | + DispatchQueue.main.async { |
211 | - // print(swiftApi().getCouponList().count) | 216 | + SwiftEventBus.post("campaigns_retrieved") |
212 | } | 217 | } |
213 | } else { | 218 | } else { |
214 | - // print("========= getCouponsRequest ERROR CampaignVC =========") | ||
215 | } | 219 | } |
216 | } | 220 | } |
217 | 221 | ... | ... |
... | @@ -4944,7 +4944,7 @@ public class swiftApi { | ... | @@ -4944,7 +4944,7 @@ public class swiftApi { |
4944 | 4944 | ||
4945 | swiftApi().setUserTag("") | 4945 | swiftApi().setUserTag("") |
4946 | swiftApi().setUserNonTelco(false) | 4946 | swiftApi().setUserNonTelco(false) |
4947 | - swiftApi().setCCMSLoyaltyCampaigns(campaigns: []) | 4947 | + // swiftApi().setCCMSLoyaltyCampaigns(campaigns: []) |
4948 | 4948 | ||
4949 | let instanceOfMyApi = MyApi() | 4949 | let instanceOfMyApi = MyApi() |
4950 | instanceOfMyApi.getCosmoteUserAsync(guid, requestCallback, failureBlock: requestFailureCallback) | 4950 | instanceOfMyApi.getCosmoteUserAsync(guid, requestCallback, failureBlock: requestFailureCallback) | ... | ... |
-
Please register or login to post a comment