Manos Chorianopoulos

add openTelco function

......@@ -96,6 +96,7 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
vc.ccms = item
vc.campaign = campaigns[indexPath.row]
self.navigationController?.pushViewController(vc, animated: true)
break;
}
}
}
......
......@@ -398,7 +398,7 @@ public class swiftApi {
let tempCoupons = matchCoupons()
swiftApi().setCouponList(tempCoupons)
let activeCoupons = coupons.filter({ return $0.status == 1 })
let activeCoupons = tempCoupons.filter({ return $0.status == 1 })
getCouponsCallback(activeCoupons)
}
......@@ -2311,6 +2311,32 @@ public class swiftApi {
}
}
public func openTelco(_ controller: UIViewController) -> Void {
for campaign in GlobalVariables.campaigns {
if (campaign._type != nil && campaign._type == "telco") {
let ccmsCampaigns = swiftApi().getCCMSLoyaltyCampaigns()
let loyaltyCampaignIdExists = ccmsCampaigns.contains { $0._loyaltyCampaignId == campaign.session_uuid }
if (loyaltyCampaignIdExists == true) {
for item in ccmsCampaigns {
if (item._loyaltyCampaignId == campaign.session_uuid) {
let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
let vc = storyboard.instantiateViewController(withIdentifier: "TelcoViewController") as! SwiftWarplyFramework.TelcoViewController
vc.ccms = item
vc.campaign = campaign
controller.navigationController?.pushViewController(vc, animated: true)
break;
}
}
break;
}
}
}
}
public func setCampaignList(_ campaigns: Array<CampaignItemModel>) -> Void {
// let userTag = self.getUserTag()
// var campaignsArray:Array<CampaignItemModel> = []
......