Showing
5 changed files
with
361 additions
and
45 deletions
No preview for this file type
| ... | @@ -172,7 +172,7 @@ import UIKit | ... | @@ -172,7 +172,7 @@ import UIKit |
| 172 | func getProfileCallback (_ profileData: swiftApi.ProfileModel?) -> Void { | 172 | func getProfileCallback (_ profileData: swiftApi.ProfileModel?) -> Void { |
| 173 | if (profileData != nil) { | 173 | if (profileData != nil) { |
| 174 | DispatchQueue.main.async { | 174 | DispatchQueue.main.async { |
| 175 | - self.numbersList = profileData?.msisdnList ?? [] | 175 | + self.numbersList = profileData?._msisdnList ?? [] |
| 176 | 176 | ||
| 177 | print("========= getProfileRequest SUCCESSSS =========") | 177 | print("========= getProfileRequest SUCCESSSS =========") |
| 178 | } | 178 | } | ... | ... |
| ... | @@ -114,7 +114,7 @@ import UIKit | ... | @@ -114,7 +114,7 @@ import UIKit |
| 114 | func getProfileCallback (_ profileData: swiftApi.ProfileModel?) -> Void { | 114 | func getProfileCallback (_ profileData: swiftApi.ProfileModel?) -> Void { |
| 115 | if (profileData != nil) { | 115 | if (profileData != nil) { |
| 116 | DispatchQueue.main.async { | 116 | DispatchQueue.main.async { |
| 117 | - self.numbersList = profileData?.msisdnList ?? [] | 117 | + self.numbersList = profileData?._msisdnList ?? [] |
| 118 | } | 118 | } |
| 119 | } else { | 119 | } else { |
| 120 | } | 120 | } | ... | ... |
| ... | @@ -69,15 +69,15 @@ import SwiftEventBus | ... | @@ -69,15 +69,15 @@ import SwiftEventBus |
| 69 | profileImage.layer.borderWidth = 1 | 69 | profileImage.layer.borderWidth = 1 |
| 70 | profileImage.layer.borderColor = UIColor(red: 0.13, green: 0.66, blue: 0.71, alpha: 1.00).cgColor | 70 | profileImage.layer.borderColor = UIColor(red: 0.13, green: 0.66, blue: 0.71, alpha: 1.00).cgColor |
| 71 | 71 | ||
| 72 | - if (profile != nil && profile?.image_url != nil && profile?.image_url != "") { | 72 | + if (profile != nil && profile?._image_url != nil && profile?._image_url != "") { |
| 73 | - profileImage.load(link: profile?.image_url ?? "", placeholder: UIImage(), cache: URLCache()) | 73 | + profileImage.load(link: profile?._image_url ?? "", placeholder: UIImage(), cache: URLCache()) |
| 74 | } else { | 74 | } else { |
| 75 | profileImage.image = UIImage(named: "default_profile_image", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil) | 75 | profileImage.image = UIImage(named: "default_profile_image", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil) |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | - print("Profile Name: " + (profile?.firstname ?? "") + " " + (profile?.lastname ?? "")) | 78 | + print("Profile Name: " + (profile?._firstname ?? "") + " " + (profile?._lastname ?? "")) |
| 79 | 79 | ||
| 80 | - profileNameLabel.text = (profile?.firstname ?? "") + " " + (profile?.lastname ?? "") | 80 | + profileNameLabel.text = (profile?._firstname ?? "") + " " + (profile?._lastname ?? "") |
| 81 | 81 | ||
| 82 | let userTag = swiftApi().getUserTag() | 82 | let userTag = swiftApi().getUserTag() |
| 83 | print("User tag: " + userTag) | 83 | print("User tag: " + userTag) | ... | ... |
| ... | @@ -956,7 +956,7 @@ public class swiftApi { | ... | @@ -956,7 +956,7 @@ public class swiftApi { |
| 956 | return (!(isCcmsOffer || isTelco)) | 956 | return (!(isCcmsOffer || isTelco)) |
| 957 | } | 957 | } |
| 958 | 958 | ||
| 959 | - if (swiftApi().getConsumer()?.answered == true) { | 959 | + if (swiftApi().getConsumer()?._answered == true) { |
| 960 | filteredCampaigns = filteredCampaigns.filter { $0.offer_category != "questionnaire" } | 960 | filteredCampaigns = filteredCampaigns.filter { $0.offer_category != "questionnaire" } |
| 961 | } | 961 | } |
| 962 | 962 | ||
| ... | @@ -1522,45 +1522,45 @@ public class swiftApi { | ... | @@ -1522,45 +1522,45 @@ public class swiftApi { |
| 1522 | 1522 | ||
| 1523 | 1523 | ||
| 1524 | public class ProfileModel { | 1524 | public class ProfileModel { |
| 1525 | - public let ack_optin: Bool? | 1525 | + private var ack_optin: Bool? |
| 1526 | - public let billing_info: [String: Any]? | 1526 | + private var billing_info: [String: Any]? |
| 1527 | - public let birthday: String? | 1527 | + private var birthday: String? |
| 1528 | - public let burnt_points: Double? | 1528 | + private var burnt_points: Double? |
| 1529 | - public let company_name: String? | 1529 | + private var company_name: String? |
| 1530 | - public let consumer_metadata: [String: Any]? | 1530 | + private var consumer_metadata: [String: Any]? |
| 1531 | - public let display_name: String? | 1531 | + private var display_name: String? |
| 1532 | - public let email: String? | 1532 | + private var email: String? |
| 1533 | - public let firstname: String? | 1533 | + private var firstname: String? |
| 1534 | - public let gender: String? | 1534 | + private var gender: String? |
| 1535 | - public let image_url: String? | 1535 | + private var image_url: String? |
| 1536 | - public let language: String? | 1536 | + private var language: String? |
| 1537 | - public let lastname: String? | 1537 | + private var lastname: String? |
| 1538 | - public let loyalty_id: String? | 1538 | + private var loyalty_id: String? |
| 1539 | - public let msisdn: String? | 1539 | + private var msisdn: String? |
| 1540 | - public let nameday: String? | 1540 | + private var nameday: String? |
| 1541 | - public let nickname: String? | 1541 | + private var nickname: String? |
| 1542 | - public let password_set: Bool? | 1542 | + private var password_set: Bool? |
| 1543 | - public let profile_metadata: [String: Any]? | 1543 | + private var profile_metadata: [String: Any]? |
| 1544 | - public let redeemed_points: Double? | 1544 | + private var redeemed_points: Double? |
| 1545 | - public let retrieved_points: Double? | 1545 | + private var retrieved_points: Double? |
| 1546 | - public let salutation: String? | 1546 | + private var salutation: String? |
| 1547 | - public let subscribe: Bool? | 1547 | + private var subscribe: Bool? |
| 1548 | - public let tags: [String: Any]? | 1548 | + private var tags: [String: Any]? |
| 1549 | - public let tax_id: String? | 1549 | + private var tax_id: String? |
| 1550 | - public let user_points: Double? | 1550 | + private var user_points: Double? |
| 1551 | - public let uuid: String? | 1551 | + private var uuid: String? |
| 1552 | - public let verified: Bool? | 1552 | + private var verified: Bool? |
| 1553 | 1553 | ||
| 1554 | // optin | 1554 | // optin |
| 1555 | - public let optin_newsletter: Bool? | 1555 | + private var optin_newsletter: Bool? |
| 1556 | - public let optin_sms: Bool? | 1556 | + private var optin_sms: Bool? |
| 1557 | - public let optin_segmentation: Bool? | 1557 | + private var optin_segmentation: Bool? |
| 1558 | - public let optin_sms_segmentation: Bool? | 1558 | + private var optin_sms_segmentation: Bool? |
| 1559 | 1559 | ||
| 1560 | // profile_metadata | 1560 | // profile_metadata |
| 1561 | - public let badge: String? | 1561 | + private var badge: String? |
| 1562 | - public let msisdnList: Array<String>? | 1562 | + private var msisdnList: Array<String>? |
| 1563 | - public let answered: Bool? | 1563 | + private var answered: Bool? |
| 1564 | 1564 | ||
| 1565 | 1565 | ||
| 1566 | public init() { | 1566 | public init() { |
| ... | @@ -1670,6 +1670,322 @@ public class swiftApi { | ... | @@ -1670,6 +1670,322 @@ public class swiftApi { |
| 1670 | } | 1670 | } |
| 1671 | 1671 | ||
| 1672 | } | 1672 | } |
| 1673 | + | ||
| 1674 | + public var _ack_optin: Bool { | ||
| 1675 | + get { // getter | ||
| 1676 | + return self.ack_optin ?? false | ||
| 1677 | + } | ||
| 1678 | + set(newValue) { //setter | ||
| 1679 | + self.ack_optin = newValue | ||
| 1680 | + } | ||
| 1681 | + } | ||
| 1682 | + | ||
| 1683 | + public var _billing_info: [String: Any] { | ||
| 1684 | + get { // getter | ||
| 1685 | + return self.billing_info ?? [String: Any]() | ||
| 1686 | + } | ||
| 1687 | + set(newValue) { //setter | ||
| 1688 | + self.billing_info = newValue | ||
| 1689 | + } | ||
| 1690 | + } | ||
| 1691 | + | ||
| 1692 | + public var _birthday: String { | ||
| 1693 | + get { // getter | ||
| 1694 | + return self.birthday ?? "" | ||
| 1695 | + } | ||
| 1696 | + set(newValue) { //setter | ||
| 1697 | + self.birthday = newValue | ||
| 1698 | + } | ||
| 1699 | + } | ||
| 1700 | + | ||
| 1701 | + public var _burnt_points: Double { | ||
| 1702 | + get { // getter | ||
| 1703 | + return self.burnt_points ?? 0.0 | ||
| 1704 | + } | ||
| 1705 | + set(newValue) { //setter | ||
| 1706 | + self.burnt_points = newValue | ||
| 1707 | + } | ||
| 1708 | + } | ||
| 1709 | + | ||
| 1710 | + public var _company_name: String { | ||
| 1711 | + get { // getter | ||
| 1712 | + return self.company_name ?? "" | ||
| 1713 | + } | ||
| 1714 | + set(newValue) { //setter | ||
| 1715 | + self.company_name = newValue | ||
| 1716 | + } | ||
| 1717 | + } | ||
| 1718 | + | ||
| 1719 | + public var _consumer_metadata: [String: Any] { | ||
| 1720 | + get { // getter | ||
| 1721 | + return self.consumer_metadata ?? [String: Any]() | ||
| 1722 | + } | ||
| 1723 | + set(newValue) { //setter | ||
| 1724 | + self.consumer_metadata = newValue | ||
| 1725 | + } | ||
| 1726 | + } | ||
| 1727 | + | ||
| 1728 | + public var _display_name: String { | ||
| 1729 | + get { // getter | ||
| 1730 | + return self.display_name ?? "" | ||
| 1731 | + } | ||
| 1732 | + set(newValue) { //setter | ||
| 1733 | + self.display_name = newValue | ||
| 1734 | + } | ||
| 1735 | + } | ||
| 1736 | + | ||
| 1737 | + public var _email: String { | ||
| 1738 | + get { // getter | ||
| 1739 | + return self.email ?? "" | ||
| 1740 | + } | ||
| 1741 | + set(newValue) { //setter | ||
| 1742 | + self.email = newValue | ||
| 1743 | + } | ||
| 1744 | + } | ||
| 1745 | + | ||
| 1746 | + public var _firstname: String { | ||
| 1747 | + get { // getter | ||
| 1748 | + return self.firstname ?? "" | ||
| 1749 | + } | ||
| 1750 | + set(newValue) { //setter | ||
| 1751 | + self.firstname = newValue | ||
| 1752 | + } | ||
| 1753 | + } | ||
| 1754 | + | ||
| 1755 | + public var _gender: String { | ||
| 1756 | + get { // getter | ||
| 1757 | + return self.gender ?? "" | ||
| 1758 | + } | ||
| 1759 | + set(newValue) { //setter | ||
| 1760 | + self.gender = newValue | ||
| 1761 | + } | ||
| 1762 | + } | ||
| 1763 | + | ||
| 1764 | + public var _image_url: String { | ||
| 1765 | + get { // getter | ||
| 1766 | + return self.image_url ?? "" | ||
| 1767 | + } | ||
| 1768 | + set(newValue) { //setter | ||
| 1769 | + self.image_url = newValue | ||
| 1770 | + } | ||
| 1771 | + } | ||
| 1772 | + | ||
| 1773 | + public var _language: String { | ||
| 1774 | + get { // getter | ||
| 1775 | + return self.language ?? "" | ||
| 1776 | + } | ||
| 1777 | + set(newValue) { //setter | ||
| 1778 | + self.language = newValue | ||
| 1779 | + } | ||
| 1780 | + } | ||
| 1781 | + | ||
| 1782 | + public var _lastname: String { | ||
| 1783 | + get { // getter | ||
| 1784 | + return self.lastname ?? "" | ||
| 1785 | + } | ||
| 1786 | + set(newValue) { //setter | ||
| 1787 | + self.lastname = newValue | ||
| 1788 | + } | ||
| 1789 | + } | ||
| 1790 | + | ||
| 1791 | + public var _loyalty_id: String { | ||
| 1792 | + get { // getter | ||
| 1793 | + return self.loyalty_id ?? "" | ||
| 1794 | + } | ||
| 1795 | + set(newValue) { //setter | ||
| 1796 | + self.loyalty_id = newValue | ||
| 1797 | + } | ||
| 1798 | + } | ||
| 1799 | + | ||
| 1800 | + public var _msisdn: String { | ||
| 1801 | + get { // getter | ||
| 1802 | + return self.msisdn ?? "" | ||
| 1803 | + } | ||
| 1804 | + set(newValue) { //setter | ||
| 1805 | + self.msisdn = newValue | ||
| 1806 | + } | ||
| 1807 | + } | ||
| 1808 | + | ||
| 1809 | + public var _nameday: String { | ||
| 1810 | + get { // getter | ||
| 1811 | + return self.nameday ?? "" | ||
| 1812 | + } | ||
| 1813 | + set(newValue) { //setter | ||
| 1814 | + self.nameday = newValue | ||
| 1815 | + } | ||
| 1816 | + } | ||
| 1817 | + | ||
| 1818 | + public var _nickname: String { | ||
| 1819 | + get { // getter | ||
| 1820 | + return self.nickname ?? "" | ||
| 1821 | + } | ||
| 1822 | + set(newValue) { //setter | ||
| 1823 | + self.nickname = newValue | ||
| 1824 | + } | ||
| 1825 | + } | ||
| 1826 | + | ||
| 1827 | + public var _password_set: Bool { | ||
| 1828 | + get { // getter | ||
| 1829 | + return self.password_set ?? false | ||
| 1830 | + } | ||
| 1831 | + set(newValue) { //setter | ||
| 1832 | + self.password_set = newValue | ||
| 1833 | + } | ||
| 1834 | + } | ||
| 1835 | + | ||
| 1836 | + public var _profile_metadata: [String: Any] { | ||
| 1837 | + get { // getter | ||
| 1838 | + return self.profile_metadata ?? [String: Any]() | ||
| 1839 | + } | ||
| 1840 | + set(newValue) { //setter | ||
| 1841 | + self.profile_metadata = newValue | ||
| 1842 | + } | ||
| 1843 | + } | ||
| 1844 | + | ||
| 1845 | + public var _redeemed_points: Double { | ||
| 1846 | + get { // getter | ||
| 1847 | + return self.redeemed_points ?? 0.0 | ||
| 1848 | + } | ||
| 1849 | + set(newValue) { //setter | ||
| 1850 | + self.redeemed_points = newValue | ||
| 1851 | + } | ||
| 1852 | + } | ||
| 1853 | + | ||
| 1854 | + public var _retrieved_points: Double { | ||
| 1855 | + get { // getter | ||
| 1856 | + return self.retrieved_points ?? 0.0 | ||
| 1857 | + } | ||
| 1858 | + set(newValue) { //setter | ||
| 1859 | + self.retrieved_points = newValue | ||
| 1860 | + } | ||
| 1861 | + } | ||
| 1862 | + | ||
| 1863 | + public var _salutation: String { | ||
| 1864 | + get { // getter | ||
| 1865 | + return self.salutation ?? "" | ||
| 1866 | + } | ||
| 1867 | + set(newValue) { //setter | ||
| 1868 | + self.salutation = newValue | ||
| 1869 | + } | ||
| 1870 | + } | ||
| 1871 | + | ||
| 1872 | + public var _subscribe: Bool { | ||
| 1873 | + get { // getter | ||
| 1874 | + return self.subscribe ?? false | ||
| 1875 | + } | ||
| 1876 | + set(newValue) { //setter | ||
| 1877 | + self.subscribe = newValue | ||
| 1878 | + } | ||
| 1879 | + } | ||
| 1880 | + | ||
| 1881 | + public var _tags: [String: Any] { | ||
| 1882 | + get { // getter | ||
| 1883 | + return self.tags ?? [String: Any]() | ||
| 1884 | + } | ||
| 1885 | + set(newValue) { //setter | ||
| 1886 | + self.tags = newValue | ||
| 1887 | + } | ||
| 1888 | + } | ||
| 1889 | + | ||
| 1890 | + public var _tax_id: String { | ||
| 1891 | + get { // getter | ||
| 1892 | + return self.tax_id ?? "" | ||
| 1893 | + } | ||
| 1894 | + set(newValue) { //setter | ||
| 1895 | + self.tax_id = newValue | ||
| 1896 | + } | ||
| 1897 | + } | ||
| 1898 | + | ||
| 1899 | + public var _user_points: Double { | ||
| 1900 | + get { // getter | ||
| 1901 | + return self.user_points ?? 0.0 | ||
| 1902 | + } | ||
| 1903 | + set(newValue) { //setter | ||
| 1904 | + self.user_points = newValue | ||
| 1905 | + } | ||
| 1906 | + } | ||
| 1907 | + | ||
| 1908 | + public var _uuid: String { | ||
| 1909 | + get { // getter | ||
| 1910 | + return self.uuid ?? "" | ||
| 1911 | + } | ||
| 1912 | + set(newValue) { //setter | ||
| 1913 | + self.uuid = newValue | ||
| 1914 | + } | ||
| 1915 | + } | ||
| 1916 | + | ||
| 1917 | + public var _verified: Bool { | ||
| 1918 | + get { // getter | ||
| 1919 | + return self.verified ?? false | ||
| 1920 | + } | ||
| 1921 | + set(newValue) { //setter | ||
| 1922 | + self.verified = newValue | ||
| 1923 | + } | ||
| 1924 | + } | ||
| 1925 | + | ||
| 1926 | + public var _optin_newsletter: Bool { | ||
| 1927 | + get { // getter | ||
| 1928 | + return self.optin_newsletter ?? false | ||
| 1929 | + } | ||
| 1930 | + set(newValue) { //setter | ||
| 1931 | + self.optin_newsletter = newValue | ||
| 1932 | + } | ||
| 1933 | + } | ||
| 1934 | + | ||
| 1935 | + public var _optin_sms: Bool { | ||
| 1936 | + get { // getter | ||
| 1937 | + return self.optin_sms ?? false | ||
| 1938 | + } | ||
| 1939 | + set(newValue) { //setter | ||
| 1940 | + self.optin_sms = newValue | ||
| 1941 | + } | ||
| 1942 | + } | ||
| 1943 | + | ||
| 1944 | + public var _optin_segmentation: Bool { | ||
| 1945 | + get { // getter | ||
| 1946 | + return self.optin_segmentation ?? false | ||
| 1947 | + } | ||
| 1948 | + set(newValue) { //setter | ||
| 1949 | + self.optin_segmentation = newValue | ||
| 1950 | + } | ||
| 1951 | + } | ||
| 1952 | + | ||
| 1953 | + public var _optin_sms_segmentation: Bool { | ||
| 1954 | + get { // getter | ||
| 1955 | + return self.optin_sms_segmentation ?? false | ||
| 1956 | + } | ||
| 1957 | + set(newValue) { //setter | ||
| 1958 | + self.optin_sms_segmentation = newValue | ||
| 1959 | + } | ||
| 1960 | + } | ||
| 1961 | + | ||
| 1962 | + public var _badge: String { | ||
| 1963 | + get { // getter | ||
| 1964 | + return self.badge ?? "" | ||
| 1965 | + } | ||
| 1966 | + set(newValue) { //setter | ||
| 1967 | + self.badge = newValue | ||
| 1968 | + } | ||
| 1969 | + } | ||
| 1970 | + | ||
| 1971 | + public var _msisdnList: Array<String> { | ||
| 1972 | + get { // getter | ||
| 1973 | + return self.msisdnList ?? [] | ||
| 1974 | + } | ||
| 1975 | + set(newValue) { //setter | ||
| 1976 | + self.msisdnList = newValue | ||
| 1977 | + } | ||
| 1978 | + } | ||
| 1979 | + | ||
| 1980 | + public var _answered: Bool { | ||
| 1981 | + get { // getter | ||
| 1982 | + return self.answered ?? false | ||
| 1983 | + } | ||
| 1984 | + set(newValue) { //setter | ||
| 1985 | + self.answered = newValue | ||
| 1986 | + } | ||
| 1987 | + } | ||
| 1988 | + | ||
| 1673 | } | 1989 | } |
| 1674 | 1990 | ||
| 1675 | public class ProfileDataModel { | 1991 | public class ProfileDataModel { |
| ... | @@ -1690,7 +2006,7 @@ public class swiftApi { | ... | @@ -1690,7 +2006,7 @@ public class swiftApi { |
| 1690 | let tempProfile = ProfileModel(dictionary: profileDataResult) | 2006 | let tempProfile = ProfileModel(dictionary: profileDataResult) |
| 1691 | 2007 | ||
| 1692 | swiftApi().setConsumer(tempProfile ?? swiftApi.ProfileModel()) | 2008 | swiftApi().setConsumer(tempProfile ?? swiftApi.ProfileModel()) |
| 1693 | - swiftApi().setUserTag(tempProfile.badge ?? "") | 2009 | + swiftApi().setUserTag(tempProfile._badge ?? "") |
| 1694 | 2010 | ||
| 1695 | getProfileCallback(tempProfile); | 2011 | getProfileCallback(tempProfile); |
| 1696 | 2012 | ||
| ... | @@ -1775,7 +2091,7 @@ public class swiftApi { | ... | @@ -1775,7 +2091,7 @@ public class swiftApi { |
| 1775 | if (profileData != nil) { | 2091 | if (profileData != nil) { |
| 1776 | DispatchQueue.main.async { | 2092 | DispatchQueue.main.async { |
| 1777 | swiftApi().setConsumer(profileData ?? swiftApi.ProfileModel()) | 2093 | swiftApi().setConsumer(profileData ?? swiftApi.ProfileModel()) |
| 1778 | - swiftApi().setUserTag(profileData?.badge ?? "") | 2094 | + swiftApi().setUserTag(profileData?._badge ?? "") |
| 1779 | } | 2095 | } |
| 1780 | } else { | 2096 | } else { |
| 1781 | 2097 | ||
| ... | @@ -3076,7 +3392,7 @@ public class swiftApi { | ... | @@ -3076,7 +3392,7 @@ public class swiftApi { |
| 3076 | return (!(isCcmsOffer || isTelco)) | 3392 | return (!(isCcmsOffer || isTelco)) |
| 3077 | } | 3393 | } |
| 3078 | 3394 | ||
| 3079 | - if (swiftApi().getConsumer()?.answered == true) { | 3395 | + if (swiftApi().getConsumer()?._answered == true) { |
| 3080 | filteredCampaigns = filteredCampaigns.filter { $0.offer_category != "questionnaire" } | 3396 | filteredCampaigns = filteredCampaigns.filter { $0.offer_category != "questionnaire" } |
| 3081 | } | 3397 | } |
| 3082 | 3398 | ... | ... |
-
Please register or login to post a comment