Showing
1 changed file
with
20 additions
and
9 deletions
| ... | @@ -833,24 +833,35 @@ public class swiftApi { | ... | @@ -833,24 +833,35 @@ public class swiftApi { |
| 833 | 833 | ||
| 834 | if let responseDataDictionary = campaignsData as? [String: AnyObject] { | 834 | if let responseDataDictionary = campaignsData as? [String: AnyObject] { |
| 835 | 835 | ||
| 836 | - if (responseDataDictionary["MAPP_CAMPAIGNING-status"] as? Int == 1) { | 836 | + if (responseDataDictionary["status"] as? Int == 1) { |
| 837 | 837 | ||
| 838 | - if let responseDataMapp = responseDataDictionary["MAPP_CAMPAIGNING"] as? [String: Any] { | 838 | + if let responseDataContext = responseDataDictionary["context"] as? [String: Any] { |
| 839 | - if let responseDataCampaigns = responseDataMapp["campaigns"] as? [[String : Any]?] { | 839 | + |
| 840 | + if (responseDataContext["MAPP_CAMPAIGNING-status"] as? Int == 1) { | ||
| 840 | 841 | ||
| 841 | - for item in responseDataCampaigns { | 842 | + if let responseDataMapp = responseDataContext["MAPP_CAMPAIGNING"] as? [String: Any] { |
| 842 | - if let itemDictionary = item { | 843 | + if let responseDataCampaigns = responseDataMapp["campaigns"] as? [[String : Any]?] { |
| 843 | - let tempCampaign = CampaignItemModel(dictionary: itemDictionary) | 844 | + |
| 844 | - campaignsArray.append(tempCampaign) | 845 | + for item in responseDataCampaigns { |
| 846 | + if let itemDictionary = item { | ||
| 847 | + let tempCampaign = CampaignItemModel(dictionary: itemDictionary) | ||
| 848 | + campaignsArray.append(tempCampaign) | ||
| 849 | + } | ||
| 850 | + } | ||
| 851 | + | ||
| 852 | + getCampaignsCallback(campaignsArray); | ||
| 845 | } | 853 | } |
| 854 | + } else { | ||
| 855 | + getCampaignsCallback(nil) | ||
| 846 | } | 856 | } |
| 847 | 857 | ||
| 848 | - getCampaignsCallback(campaignsArray); | 858 | + } else { |
| 859 | + getCampaignsCallback(nil) | ||
| 849 | } | 860 | } |
| 861 | + | ||
| 850 | } else { | 862 | } else { |
| 851 | getCampaignsCallback(nil) | 863 | getCampaignsCallback(nil) |
| 852 | } | 864 | } |
| 853 | - | ||
| 854 | } else { | 865 | } else { |
| 855 | getCampaignsCallback(nil) | 866 | getCampaignsCallback(nil) |
| 856 | } | 867 | } | ... | ... |
-
Please register or login to post a comment