Manos Chorianopoulos

fix campaigns refresh after ccms activation

......@@ -198,20 +198,24 @@ var timer2: DispatchSourceTimer?
SwiftEventBus.post("coupon_retrieved", sender: couponEvent)
swiftApi().getCouponsAsync(getCouponsCallback)
swiftApi().getCampaignsAsyncNew(language: "en", filters: [String : Any](), getCampaignsCallback)
func getCouponsCallback (_ couponsData: Array<swiftApi.CouponItemModel>?) -> Void {
if (couponsData != nil) {
DispatchQueue.main.async {
SwiftEventBus.post("coupons_fetched")
}
} else {
}
}
// print("========= getCouponsRequest SUCCESSSS CampaignVC =========")
// print("========= getCouponsRequest count CampaignVC =========")
// print(swiftApi().getCouponList().count)
func getCampaignsCallback (_ campaignsData: Array<swiftApi.CampaignItemModel>?) -> Void {
if (campaignsData != nil) {
DispatchQueue.main.async {
SwiftEventBus.post("campaigns_retrieved")
}
} else {
// print("========= getCouponsRequest ERROR CampaignVC =========")
}
}
......
......@@ -4944,7 +4944,7 @@ public class swiftApi {
swiftApi().setUserTag("")
swiftApi().setUserNonTelco(false)
swiftApi().setCCMSLoyaltyCampaigns(campaigns: [])
// swiftApi().setCCMSLoyaltyCampaigns(campaigns: [])
let instanceOfMyApi = MyApi()
instanceOfMyApi.getCosmoteUserAsync(guid, requestCallback, failureBlock: requestFailureCallback)
......