Manos Chorianopoulos

rollback session expiration

...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
7 <key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key> 7 <key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
8 <dict> 8 <dict>
9 <key>orderHint</key> 9 <key>orderHint</key>
10 - <integer>1</integer> 10 + <integer>0</integer>
11 </dict> 11 </dict>
12 </dict> 12 </dict>
13 </dict> 13 </dict>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
7 <key>SwiftWarplyFramework.xcscheme_^#shared#^_</key> 7 <key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
8 <dict> 8 <dict>
9 <key>orderHint</key> 9 <key>orderHint</key>
10 - <integer>0</integer> 10 + <integer>1</integer>
11 </dict> 11 </dict>
12 </dict> 12 </dict>
13 </dict> 13 </dict>
......
...@@ -676,32 +676,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -676,32 +676,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
676 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 676 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
677 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 677 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
678 678
679 - NSString* errorDomain = [error domain]; 679 +// NSString* errorDomain = [error domain];
680 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 680 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
681 +//
682 +// if (failure) {
683 +// failure(errorToken);
684 +// }
681 685
686 + [self refreshToken:^(NSDictionary *response) {
687 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
688 + if (success) {
689 + success(contextResponse);
690 + }
691 + NSLog(@"**************** WARPLY Response *****************" );
692 + NSLog(@"%@", contextResponse );
693 + } failureBlock:^(NSError *error) {
682 if (failure) { 694 if (failure) {
683 - failure(errorToken); 695 + failure(error);
684 } 696 }
685 - 697 + }];
686 -// [self refreshToken:^(NSDictionary *response) { 698 + } failureBlock:^(NSError *error) {
687 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 699 + if (failure) {
688 -// if (success) { 700 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
689 -// success(contextResponse); 701 + failure(error);
690 -// } 702 + }
691 -// NSLog(@"**************** WARPLY Response *****************" ); 703 + NSLog(@"Error at token %@", error );
692 -// NSLog(@"%@", contextResponse ); 704 + }];
693 -// } failureBlock:^(NSError *error) {
694 -// if (failure) {
695 -// failure(error);
696 -// }
697 -// }];
698 -// } failureBlock:^(NSError *error) {
699 -// if (failure) {
700 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
701 -// failure(error);
702 -// }
703 -// NSLog(@"Error at token %@", error );
704 -// }];
705 } else { 705 } else {
706 NSLog(@"Error at get Campaigns Personalized %@", error ); 706 NSLog(@"Error at get Campaigns Personalized %@", error );
707 failure(error); 707 failure(error);
...@@ -1738,30 +1738,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -1738,30 +1738,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
1738 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 1738 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
1739 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 1739 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
1740 1740
1741 - NSString* errorDomain = [error domain]; 1741 +// NSString* errorDomain = [error domain];
1742 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 1742 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
1743 +//
1744 +// if (failure) {
1745 +// failure(errorToken);
1746 +// }
1743 1747
1748 + [self refreshToken:^(NSDictionary *response) {
1749 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
1750 + if (success) {
1751 + success(contextResponse);
1752 + }
1753 + } failureBlock:^(NSError *error) {
1744 if (failure) { 1754 if (failure) {
1745 - failure(errorToken); 1755 + failure(error);
1746 } 1756 }
1747 - 1757 + }];
1748 -// [self refreshToken:^(NSDictionary *response) { 1758 + } failureBlock:^(NSError *error) {
1749 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 1759 + if (failure) {
1750 -// if (success) { 1760 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
1751 -// success(contextResponse); 1761 + failure(error);
1752 -// } 1762 + }
1753 -// } failureBlock:^(NSError *error) { 1763 + NSLog(@"Error at token %@", error );
1754 -// if (failure) { 1764 + }];
1755 -// failure(error);
1756 -// }
1757 -// }];
1758 -// } failureBlock:^(NSError *error) {
1759 -// if (failure) {
1760 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
1761 -// failure(error);
1762 -// }
1763 -// NSLog(@"Error at token %@", error );
1764 -// }];
1765 } else { 1765 } else {
1766 NSLog(@"Error at change password %@", error ); 1766 NSLog(@"Error at change password %@", error );
1767 failure(error); 1767 failure(error);
...@@ -1804,33 +1804,33 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -1804,33 +1804,33 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
1804 1804
1805 // NSError *errorToken = [NSError errorWithDomain:WARP_ERROR_DOMAIN code:401 userInfo:@{NSLocalizedDescriptionKey: NSLocalizedString(@"Empty response", @"Warply")}]; 1805 // NSError *errorToken = [NSError errorWithDomain:WARP_ERROR_DOMAIN code:401 userInfo:@{NSLocalizedDescriptionKey: NSLocalizedString(@"Empty response", @"Warply")}];
1806 1806
1807 - NSString* errorDomain = [error domain]; 1807 +// NSString* errorDomain = [error domain];
1808 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 1808 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
1809 -
1810 - if (failure) {
1811 - failure(errorToken);
1812 - }
1813 -
1814 -// [self refreshToken:^(NSDictionary *response) {
1815 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
1816 -// if (success) {
1817 -// success(contextResponse);
1818 -// }
1819 -// NSLog(@"**************** WARPLY Response *****************" );
1820 -// NSLog(@"%@", contextResponse );
1821 -// } failureBlock:^(NSError *error) {
1822 // 1809 //
1823 // if (failure) { 1810 // if (failure) {
1824 -// failure(error); 1811 +// failure(errorToken);
1825 -// }
1826 -// }];
1827 -// } failureBlock:^(NSError *error) {
1828 -// if (failure) {
1829 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
1830 -// failure(error);
1831 // } 1812 // }
1832 -// NSLog(@"Error at token %@", error ); 1813 +
1833 -// }]; 1814 + [self refreshToken:^(NSDictionary *response) {
1815 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
1816 + if (success) {
1817 + success(contextResponse);
1818 + }
1819 + NSLog(@"**************** WARPLY Response *****************" );
1820 + NSLog(@"%@", contextResponse );
1821 + } failureBlock:^(NSError *error) {
1822 +
1823 + if (failure) {
1824 + failure(error);
1825 + }
1826 + }];
1827 + } failureBlock:^(NSError *error) {
1828 + if (failure) {
1829 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
1830 + failure(error);
1831 + }
1832 + NSLog(@"Error at token %@", error );
1833 + }];
1834 } else { 1834 } else {
1835 NSLog(@"Error at get profile %@", error ); 1835 NSLog(@"Error at get profile %@", error );
1836 failure(error); 1836 failure(error);
...@@ -1876,32 +1876,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -1876,32 +1876,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
1876 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 1876 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
1877 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 1877 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
1878 1878
1879 - NSString* errorDomain = [error domain]; 1879 +// NSString* errorDomain = [error domain];
1880 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 1880 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
1881 +//
1882 +// if (failure) {
1883 +// failure(errorToken);
1884 +// }
1881 1885
1886 + [self refreshToken:^(NSDictionary *response) {
1887 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
1888 + if (success) {
1889 + success(contextResponse);
1890 + }
1891 + NSLog(@"**************** WARPLY Response *****************" );
1892 + NSLog(@"%@", contextResponse );
1893 + } failureBlock:^(NSError *error) {
1882 if (failure) { 1894 if (failure) {
1883 - failure(errorToken); 1895 + failure(error);
1884 } 1896 }
1885 - 1897 + }];
1886 -// [self refreshToken:^(NSDictionary *response) { 1898 + } failureBlock:^(NSError *error) {
1887 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 1899 + if (failure) {
1888 -// if (success) { 1900 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
1889 -// success(contextResponse); 1901 + failure(error);
1890 -// } 1902 + }
1891 -// NSLog(@"**************** WARPLY Response *****************" ); 1903 + NSLog(@"Error at token %@", error );
1892 -// NSLog(@"%@", contextResponse ); 1904 + }];
1893 -// } failureBlock:^(NSError *error) {
1894 -// if (failure) {
1895 -// failure(error);
1896 -// }
1897 -// }];
1898 -// } failureBlock:^(NSError *error) {
1899 -// if (failure) {
1900 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
1901 -// failure(error);
1902 -// }
1903 -// NSLog(@"Error at token %@", error );
1904 -// }];
1905 } else { 1905 } else {
1906 NSLog(@"Error at post Event %@", error ); 1906 NSLog(@"Error at post Event %@", error );
1907 failure(error); 1907 failure(error);
...@@ -1992,32 +1992,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -1992,32 +1992,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
1992 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 1992 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
1993 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 1993 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
1994 1994
1995 - NSString* errorDomain = [error domain]; 1995 +// NSString* errorDomain = [error domain];
1996 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 1996 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
1997 +//
1998 +// if (failure) {
1999 +// failure(errorToken);
2000 +// }
1997 2001
2002 + [self refreshToken:^(NSDictionary *response) {
2003 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
2004 + if (success) {
2005 + success(contextResponse);
2006 + }
2007 + NSLog(@"**************** WARPLY Response *****************" );
2008 + NSLog(@"%@", contextResponse );
2009 + } failureBlock:^(NSError *error) {
1998 if (failure) { 2010 if (failure) {
1999 - failure(errorToken); 2011 + failure(error);
2000 } 2012 }
2001 - 2013 + }];
2002 -// [self refreshToken:^(NSDictionary *response) { 2014 + } failureBlock:^(NSError *error) {
2003 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 2015 + if (failure) {
2004 -// if (success) { 2016 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2005 -// success(contextResponse); 2017 + failure(error);
2006 -// } 2018 + }
2007 -// NSLog(@"**************** WARPLY Response *****************" ); 2019 + NSLog(@"Error at token %@", error );
2008 -// NSLog(@"%@", contextResponse ); 2020 + }];
2009 -// } failureBlock:^(NSError *error) {
2010 -// if (failure) {
2011 -// failure(error);
2012 -// }
2013 -// }];
2014 -// } failureBlock:^(NSError *error) {
2015 -// if (failure) {
2016 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
2017 -// failure(error);
2018 -// }
2019 -// NSLog(@"Error at token %@", error );
2020 -// }];
2021 } else { 2021 } else {
2022 NSLog(@"Error at edit profile %@", error ); 2022 NSLog(@"Error at edit profile %@", error );
2023 failure(error); 2023 failure(error);
...@@ -2043,32 +2043,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2043,32 +2043,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2043 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 2043 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
2044 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 2044 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
2045 2045
2046 - NSString* errorDomain = [error domain]; 2046 +// NSString* errorDomain = [error domain];
2047 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 2047 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
2048 +//
2049 +// if (failure) {
2050 +// failure(errorToken);
2051 +// }
2048 2052
2053 + [self refreshToken:^(NSDictionary *response) {
2054 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
2055 + if (success) {
2056 + success(contextResponse);
2057 + }
2058 + NSLog(@"**************** WARPLY Response *****************" );
2059 + NSLog(@"%@", contextResponse );
2060 + } failureBlock:^(NSError *error) {
2049 if (failure) { 2061 if (failure) {
2050 - failure(errorToken); 2062 + failure(error);
2051 } 2063 }
2052 - 2064 + }];
2053 -// [self refreshToken:^(NSDictionary *response) { 2065 + } failureBlock:^(NSError *error) {
2054 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 2066 + if (failure) {
2055 -// if (success) { 2067 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2056 -// success(contextResponse); 2068 + failure(error);
2057 -// } 2069 + }
2058 -// NSLog(@"**************** WARPLY Response *****************" ); 2070 + NSLog(@"Error at token %@", error );
2059 -// NSLog(@"%@", contextResponse ); 2071 + }];
2060 -// } failureBlock:^(NSError *error) {
2061 -// if (failure) {
2062 -// failure(error);
2063 -// }
2064 -// }];
2065 -// } failureBlock:^(NSError *error) {
2066 -// if (failure) {
2067 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
2068 -// failure(error);
2069 -// }
2070 -// NSLog(@"Error at token %@", error );
2071 -// }];
2072 } else { 2072 } else {
2073 NSLog(@"Error at get pacing details %@", error ); 2073 NSLog(@"Error at get pacing details %@", error );
2074 failure(error); 2074 failure(error);
...@@ -2094,32 +2094,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2094,32 +2094,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2094 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 2094 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
2095 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 2095 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
2096 2096
2097 - NSString* errorDomain = [error domain]; 2097 +// NSString* errorDomain = [error domain];
2098 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 2098 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
2099 +//
2100 +// if (failure) {
2101 +// failure(errorToken);
2102 +// }
2099 2103
2104 + [self refreshToken:^(NSDictionary *response) {
2105 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
2106 + if (success) {
2107 + success(contextResponse);
2108 + }
2109 + NSLog(@"**************** WARPLY Response *****************" );
2110 + NSLog(@"%@", contextResponse );
2111 + } failureBlock:^(NSError *error) {
2100 if (failure) { 2112 if (failure) {
2101 - failure(errorToken); 2113 + failure(error);
2102 } 2114 }
2103 - 2115 + }];
2104 -// [self refreshToken:^(NSDictionary *response) { 2116 + } failureBlock:^(NSError *error) {
2105 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 2117 + if (failure) {
2106 -// if (success) { 2118 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2107 -// success(contextResponse); 2119 + failure(error);
2108 -// } 2120 + }
2109 -// NSLog(@"**************** WARPLY Response *****************" ); 2121 + NSLog(@"Error at token %@", error );
2110 -// NSLog(@"%@", contextResponse ); 2122 + }];
2111 -// } failureBlock:^(NSError *error) {
2112 -// if (failure) {
2113 -// failure(error);
2114 -// }
2115 -// }];
2116 -// } failureBlock:^(NSError *error) {
2117 -// if (failure) {
2118 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
2119 -// failure(error);
2120 -// }
2121 -// NSLog(@"Error at token %@", error );
2122 -// }];
2123 } else { 2123 } else {
2124 NSLog(@"Error at set pacing details %@", error ); 2124 NSLog(@"Error at set pacing details %@", error );
2125 failure(error); 2125 failure(error);
...@@ -2182,32 +2182,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2182,32 +2182,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2182 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 2182 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
2183 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 2183 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
2184 2184
2185 - NSString* errorDomain = [error domain]; 2185 +// NSString* errorDomain = [error domain];
2186 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 2186 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
2187 +//
2188 +// if (failure) {
2189 +// failure(errorToken);
2190 +// }
2187 2191
2192 + [self refreshToken:^(NSDictionary *response) {
2193 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
2194 + if (success) {
2195 + success(contextResponse);
2196 + }
2197 + NSLog(@"**************** WARPLY Response *****************" );
2198 + NSLog(@"%@", contextResponse );
2199 + } failureBlock:^(NSError *error) {
2188 if (failure) { 2200 if (failure) {
2189 - failure(errorToken); 2201 + failure(error);
2190 } 2202 }
2191 - 2203 + }];
2192 -// [self refreshToken:^(NSDictionary *response) { 2204 + } failureBlock:^(NSError *error) {
2193 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 2205 + if (failure) {
2194 -// if (success) { 2206 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2195 -// success(contextResponse); 2207 + failure(error);
2196 -// } 2208 + }
2197 -// NSLog(@"**************** WARPLY Response *****************" ); 2209 + NSLog(@"Error at token %@", error );
2198 -// NSLog(@"%@", contextResponse ); 2210 + }];
2199 -// } failureBlock:^(NSError *error) {
2200 -// if (failure) {
2201 -// failure(error);
2202 -// }
2203 -// }];
2204 -// } failureBlock:^(NSError *error) {
2205 -// if (failure) {
2206 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
2207 -// failure(error);
2208 -// }
2209 -// NSLog(@"Error at token %@", error );
2210 -// }];
2211 } else { 2211 } else {
2212 NSLog(@"Error at consumer Integration %@", error ); 2212 NSLog(@"Error at consumer Integration %@", error );
2213 failure(error); 2213 failure(error);
...@@ -2231,30 +2231,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2231,30 +2231,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2231 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 2231 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
2232 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 2232 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
2233 2233
2234 - NSString* errorDomain = [error domain]; 2234 +// NSString* errorDomain = [error domain];
2235 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 2235 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
2236 +//
2237 +// if (failure) {
2238 +// failure(errorToken);
2239 +// }
2236 2240
2241 + [self refreshToken:^(NSDictionary *response) {
2242 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
2243 + if (success) {
2244 + success(contextResponse);
2245 + }
2246 + } failureBlock:^(NSError *error) {
2237 if (failure) { 2247 if (failure) {
2238 - failure(errorToken); 2248 + failure(error);
2239 } 2249 }
2240 - 2250 + }];
2241 -// [self refreshToken:^(NSDictionary *response) { 2251 + } failureBlock:^(NSError *error) {
2242 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 2252 + if (failure) {
2243 -// if (success) { 2253 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2244 -// success(contextResponse); 2254 + failure(error);
2245 -// } 2255 + }
2246 -// } failureBlock:^(NSError *error) { 2256 + NSLog(@"Error at token %@", error );
2247 -// if (failure) { 2257 + }];
2248 -// failure(error);
2249 -// }
2250 -// }];
2251 -// } failureBlock:^(NSError *error) {
2252 -// if (failure) {
2253 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
2254 -// failure(error);
2255 -// }
2256 -// NSLog(@"Error at token %@", error );
2257 -// }];
2258 } else { 2258 } else {
2259 NSLog(@"Error at change profile image %@", error ); 2259 NSLog(@"Error at change profile image %@", error );
2260 failure(error); 2260 failure(error);
...@@ -2278,30 +2278,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2278,30 +2278,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2278 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 2278 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
2279 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 2279 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
2280 2280
2281 - NSString* errorDomain = [error domain]; 2281 +// NSString* errorDomain = [error domain];
2282 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 2282 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
2283 +//
2284 +// if (failure) {
2285 +// failure(errorToken);
2286 +// }
2283 2287
2288 + [self refreshToken:^(NSDictionary *response) {
2289 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
2290 + if (success) {
2291 + success(contextResponse);
2292 + }
2293 + } failureBlock:^(NSError *error) {
2284 if (failure) { 2294 if (failure) {
2285 - failure(errorToken); 2295 + failure(error);
2286 } 2296 }
2287 - 2297 + }];
2288 -// [self refreshToken:^(NSDictionary *response) { 2298 + } failureBlock:^(NSError *error) {
2289 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 2299 + if (failure) {
2290 -// if (success) { 2300 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2291 -// success(contextResponse); 2301 + failure(error);
2292 -// } 2302 + }
2293 -// } failureBlock:^(NSError *error) { 2303 + NSLog(@"Error at token %@", error );
2294 -// if (failure) { 2304 + }];
2295 -// failure(error);
2296 -// }
2297 -// }];
2298 -// } failureBlock:^(NSError *error) {
2299 -// if (failure) {
2300 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
2301 -// failure(error);
2302 -// }
2303 -// NSLog(@"Error at token %@", error );
2304 -// }];
2305 } else { 2305 } else {
2306 NSLog(@"Error at add card %@", error ); 2306 NSLog(@"Error at add card %@", error );
2307 failure(error); 2307 failure(error);
...@@ -2325,30 +2325,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2325,30 +2325,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2325 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 2325 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
2326 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 2326 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
2327 2327
2328 - NSString* errorDomain = [error domain]; 2328 +// NSString* errorDomain = [error domain];
2329 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 2329 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
2330 +//
2331 +// if (failure) {
2332 +// failure(errorToken);
2333 +// }
2330 2334
2335 + [self refreshToken:^(NSDictionary *response) {
2336 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
2337 + if (success) {
2338 + success(contextResponse);
2339 + }
2340 + } failureBlock:^(NSError *error) {
2331 if (failure) { 2341 if (failure) {
2332 - failure(errorToken); 2342 + failure(error);
2333 } 2343 }
2334 - 2344 + }];
2335 -// [self refreshToken:^(NSDictionary *response) { 2345 + } failureBlock:^(NSError *error) {
2336 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 2346 + if (failure) {
2337 -// if (success) { 2347 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2338 -// success(contextResponse); 2348 + failure(error);
2339 -// } 2349 + }
2340 -// } failureBlock:^(NSError *error) { 2350 + NSLog(@"Error at token %@", error );
2341 -// if (failure) { 2351 + }];
2342 -// failure(error);
2343 -// }
2344 -// }];
2345 -// } failureBlock:^(NSError *error) {
2346 -// if (failure) {
2347 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
2348 -// failure(error);
2349 -// }
2350 -// NSLog(@"Error at token %@", error );
2351 -// }];
2352 } else { 2352 } else {
2353 NSLog(@"Error at get cards %@", error ); 2353 NSLog(@"Error at get cards %@", error );
2354 failure(error); 2354 failure(error);
...@@ -2372,30 +2372,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2372,30 +2372,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2372 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 2372 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
2373 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 2373 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
2374 2374
2375 - NSString* errorDomain = [error domain]; 2375 +// NSString* errorDomain = [error domain];
2376 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 2376 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
2377 +//
2378 +// if (failure) {
2379 +// failure(errorToken);
2380 +// }
2377 2381
2382 + [self refreshToken:^(NSDictionary *response) {
2383 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
2384 + if (success) {
2385 + success(contextResponse);
2386 + }
2387 + } failureBlock:^(NSError *error) {
2378 if (failure) { 2388 if (failure) {
2379 - failure(errorToken); 2389 + failure(error);
2380 } 2390 }
2381 - 2391 + }];
2382 -// [self refreshToken:^(NSDictionary *response) { 2392 + } failureBlock:^(NSError *error) {
2383 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 2393 + if (failure) {
2384 -// if (success) { 2394 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2385 -// success(contextResponse); 2395 + failure(error);
2386 -// } 2396 + }
2387 -// } failureBlock:^(NSError *error) { 2397 + NSLog(@"Error at token %@", error );
2388 -// if (failure) { 2398 + }];
2389 -// failure(error);
2390 -// }
2391 -// }];
2392 -// } failureBlock:^(NSError *error) {
2393 -// if (failure) {
2394 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
2395 -// failure(error);
2396 -// }
2397 -// NSLog(@"Error at token %@", error );
2398 -// }];
2399 } else { 2399 } else {
2400 NSLog(@"Error at get delete card %@", error ); 2400 NSLog(@"Error at get delete card %@", error );
2401 failure(error); 2401 failure(error);
...@@ -2523,32 +2523,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2523,32 +2523,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2523 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 2523 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
2524 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 2524 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
2525 2525
2526 - NSString* errorDomain = [error domain]; 2526 +// NSString* errorDomain = [error domain];
2527 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 2527 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
2528 +//
2529 +// if (failure) {
2530 +// failure(errorToken);
2531 +// }
2528 2532
2533 + [self refreshToken:^(NSDictionary *response) {
2534 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
2535 + if (success) {
2536 + success(contextResponse);
2537 + }
2538 + NSLog(@"**************** WARPLY Response *****************" );
2539 + NSLog(@"%@", contextResponse );
2540 + } failureBlock:^(NSError *error) {
2529 if (failure) { 2541 if (failure) {
2530 - failure(errorToken); 2542 + failure(error);
2531 } 2543 }
2532 - 2544 + }];
2533 -// [self refreshToken:^(NSDictionary *response) { 2545 + } failureBlock:^(NSError *error) {
2534 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 2546 + if (failure) {
2535 -// if (success) { 2547 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2536 -// success(contextResponse); 2548 + failure(error);
2537 -// } 2549 + }
2538 -// NSLog(@"**************** WARPLY Response *****************" ); 2550 + NSLog(@"Error at token %@", error );
2539 -// NSLog(@"%@", contextResponse ); 2551 + }];
2540 -// } failureBlock:^(NSError *error) {
2541 -// if (failure) {
2542 -// failure(error);
2543 -// }
2544 -// }];
2545 -// } failureBlock:^(NSError *error) {
2546 -// if (failure) {
2547 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
2548 -// failure(error);
2549 -// }
2550 -// NSLog(@"Error at token %@", error );
2551 -// }];
2552 } else { 2552 } else {
2553 NSLog(@"Error at get coupons %@", error ); 2553 NSLog(@"Error at get coupons %@", error );
2554 failure(error); 2554 failure(error);
...@@ -2572,30 +2572,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2572,30 +2572,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2572 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 2572 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
2573 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 2573 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
2574 2574
2575 - NSString* errorDomain = [error domain]; 2575 +// NSString* errorDomain = [error domain];
2576 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 2576 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
2577 +//
2578 +// if (failure) {
2579 +// failure(errorToken);
2580 +// }
2577 2581
2582 + [self refreshToken:^(NSDictionary *response) {
2583 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
2584 + if (success) {
2585 + success(contextResponse);
2586 + }
2587 + } failureBlock:^(NSError *error) {
2578 if (failure) { 2588 if (failure) {
2579 - failure(errorToken); 2589 + failure(error);
2580 } 2590 }
2581 - 2591 + }];
2582 -// [self refreshToken:^(NSDictionary *response) { 2592 + } failureBlock:^(NSError *error) {
2583 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 2593 + if (failure) {
2584 -// if (success) { 2594 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2585 -// success(contextResponse); 2595 + failure(error);
2586 -// } 2596 + }
2587 -// } failureBlock:^(NSError *error) { 2597 + NSLog(@"Error at token %@", error );
2588 -// if (failure) { 2598 + }];
2589 -// failure(error);
2590 -// }
2591 -// }];
2592 -// } failureBlock:^(NSError *error) {
2593 -// if (failure) {
2594 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
2595 -// failure(error);
2596 -// }
2597 -// NSLog(@"Error at token %@", error );
2598 -// }];
2599 } else { 2599 } else {
2600 NSLog(@"Error at get transaction history %@", error ); 2600 NSLog(@"Error at get transaction history %@", error );
2601 failure(error); 2601 failure(error);
...@@ -2619,30 +2619,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2619,30 +2619,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2619 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 2619 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
2620 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 2620 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
2621 2621
2622 - NSString* errorDomain = [error domain]; 2622 +// NSString* errorDomain = [error domain];
2623 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 2623 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
2624 +//
2625 +// if (failure) {
2626 +// failure(errorToken);
2627 +// }
2624 2628
2629 + [self refreshToken:^(NSDictionary *response) {
2630 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
2631 + if (success) {
2632 + success(contextResponse);
2633 + }
2634 + } failureBlock:^(NSError *error) {
2625 if (failure) { 2635 if (failure) {
2626 - failure(errorToken); 2636 + failure(error);
2627 } 2637 }
2628 - 2638 + }];
2629 -// [self refreshToken:^(NSDictionary *response) { 2639 + } failureBlock:^(NSError *error) {
2630 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 2640 + if (failure) {
2631 -// if (success) { 2641 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2632 -// success(contextResponse); 2642 + failure(error);
2633 -// } 2643 + }
2634 -// } failureBlock:^(NSError *error) { 2644 + NSLog(@"Error at token %@", error );
2635 -// if (failure) { 2645 + }];
2636 -// failure(error);
2637 -// }
2638 -// }];
2639 -// } failureBlock:^(NSError *error) {
2640 -// if (failure) {
2641 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
2642 -// failure(error);
2643 -// }
2644 -// NSLog(@"Error at token %@", error );
2645 -// }];
2646 } else { 2646 } else {
2647 NSLog(@"Error at get points history %@", error ); 2647 NSLog(@"Error at get points history %@", error );
2648 failure(error); 2648 failure(error);
...@@ -2668,32 +2668,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2668,32 +2668,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2668 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 2668 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
2669 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 2669 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
2670 2670
2671 - NSString* errorDomain = [error domain]; 2671 +// NSString* errorDomain = [error domain];
2672 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 2672 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
2673 +//
2674 +// if (failure) {
2675 +// failure(errorToken);
2676 +// }
2673 2677
2678 + [self refreshToken:^(NSDictionary *response) {
2679 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
2680 + if (success) {
2681 + success(contextResponse);
2682 + }
2683 + NSLog(@"**************** WARPLY Response *****************" );
2684 + NSLog(@"%@", contextResponse );
2685 + } failureBlock:^(NSError *error) {
2674 if (failure) { 2686 if (failure) {
2675 - failure(errorToken); 2687 + failure(error);
2676 } 2688 }
2677 - 2689 + }];
2678 -// [self refreshToken:^(NSDictionary *response) { 2690 + } failureBlock:^(NSError *error) {
2679 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 2691 + if (failure) {
2680 -// if (success) { 2692 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2681 -// success(contextResponse); 2693 + failure(error);
2682 -// } 2694 + }
2683 -// NSLog(@"**************** WARPLY Response *****************" ); 2695 + NSLog(@"Error at token %@", error );
2684 -// NSLog(@"%@", contextResponse ); 2696 + }];
2685 -// } failureBlock:^(NSError *error) {
2686 -// if (failure) {
2687 -// failure(error);
2688 -// }
2689 -// }];
2690 -// } failureBlock:^(NSError *error) {
2691 -// if (failure) {
2692 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
2693 -// failure(error);
2694 -// }
2695 -// NSLog(@"Error at token %@", error );
2696 -// }];
2697 } else { 2697 } else {
2698 NSLog(@"Error at get Sharing History %@", error ); 2698 NSLog(@"Error at get Sharing History %@", error );
2699 failure(error); 2699 failure(error);
...@@ -2717,30 +2717,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2717,30 +2717,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2717 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 2717 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
2718 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 2718 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
2719 2719
2720 - NSString* errorDomain = [error domain]; 2720 +// NSString* errorDomain = [error domain];
2721 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 2721 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
2722 +//
2723 +// if (failure) {
2724 +// failure(errorToken);
2725 +// }
2722 2726
2727 + [self refreshToken:^(NSDictionary *response) {
2728 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
2729 + if (success) {
2730 + success(contextResponse);
2731 + }
2732 + } failureBlock:^(NSError *error) {
2723 if (failure) { 2733 if (failure) {
2724 - failure(errorToken); 2734 + failure(error);
2725 } 2735 }
2726 - 2736 + }];
2727 -// [self refreshToken:^(NSDictionary *response) { 2737 + } failureBlock:^(NSError *error) {
2728 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 2738 + if (failure) {
2729 -// if (success) { 2739 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2730 -// success(contextResponse); 2740 + failure(error);
2731 -// } 2741 + }
2732 -// } failureBlock:^(NSError *error) { 2742 + NSLog(@"Error at token %@", error );
2733 -// if (failure) { 2743 + }];
2734 -// failure(error);
2735 -// }
2736 -// }];
2737 -// } failureBlock:^(NSError *error) {
2738 -// if (failure) {
2739 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
2740 -// failure(error);
2741 -// }
2742 -// NSLog(@"Error at token %@", error );
2743 -// }];
2744 } else { 2744 } else {
2745 NSLog(@"Error at add address %@", error ); 2745 NSLog(@"Error at add address %@", error );
2746 failure(error); 2746 failure(error);
...@@ -2764,30 +2764,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2764,30 +2764,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2764 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 2764 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
2765 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 2765 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
2766 2766
2767 - NSString* errorDomain = [error domain]; 2767 +// NSString* errorDomain = [error domain];
2768 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 2768 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
2769 +//
2770 +// if (failure) {
2771 +// failure(errorToken);
2772 +// }
2769 2773
2774 + [self refreshToken:^(NSDictionary *response) {
2775 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
2776 + if (success) {
2777 + success(contextResponse);
2778 + }
2779 + } failureBlock:^(NSError *error) {
2770 if (failure) { 2780 if (failure) {
2771 - failure(errorToken); 2781 + failure(error);
2772 } 2782 }
2773 - 2783 + }];
2774 -// [self refreshToken:^(NSDictionary *response) { 2784 + } failureBlock:^(NSError *error) {
2775 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 2785 + if (failure) {
2776 -// if (success) { 2786 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2777 -// success(contextResponse); 2787 + failure(error);
2778 -// } 2788 + }
2779 -// } failureBlock:^(NSError *error) { 2789 + NSLog(@"Error at token %@", error );
2780 -// if (failure) { 2790 + }];
2781 -// failure(error);
2782 -// }
2783 -// }];
2784 -// } failureBlock:^(NSError *error) {
2785 -// if (failure) {
2786 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
2787 -// failure(error);
2788 -// }
2789 -// NSLog(@"Error at token %@", error );
2790 -// }];
2791 } else { 2791 } else {
2792 NSLog(@"Error at get address %@", error ); 2792 NSLog(@"Error at get address %@", error );
2793 failure(error); 2793 failure(error);
...@@ -2856,30 +2856,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2856,30 +2856,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2856 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 2856 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
2857 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 2857 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
2858 2858
2859 - NSString* errorDomain = [error domain]; 2859 +// NSString* errorDomain = [error domain];
2860 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 2860 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
2861 +//
2862 +// if (failure) {
2863 +// failure(errorToken);
2864 +// }
2861 2865
2866 + [self refreshToken:^(NSDictionary *response) {
2867 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
2868 + if (success) {
2869 + success(contextResponse);
2870 + }
2871 + } failureBlock:^(NSError *error) {
2862 if (failure) { 2872 if (failure) {
2863 - failure(errorToken); 2873 + failure(error);
2864 } 2874 }
2865 - 2875 + }];
2866 -// [self refreshToken:^(NSDictionary *response) { 2876 + } failureBlock:^(NSError *error) {
2867 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 2877 + if (failure) {
2868 -// if (success) { 2878 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2869 -// success(contextResponse); 2879 + failure(error);
2870 -// } 2880 + }
2871 -// } failureBlock:^(NSError *error) { 2881 + NSLog(@"Error at token %@", error );
2872 -// if (failure) { 2882 + }];
2873 -// failure(error);
2874 -// }
2875 -// }];
2876 -// } failureBlock:^(NSError *error) {
2877 -// if (failure) {
2878 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
2879 -// failure(error);
2880 -// }
2881 -// NSLog(@"Error at token %@", error );
2882 -// }];
2883 } else { 2883 } else {
2884 NSLog(@"Error at edit address %@", error ); 2884 NSLog(@"Error at edit address %@", error );
2885 failure(error); 2885 failure(error);
...@@ -2903,30 +2903,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2903,30 +2903,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2903 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 2903 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
2904 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 2904 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
2905 2905
2906 - NSString* errorDomain = [error domain]; 2906 +// NSString* errorDomain = [error domain];
2907 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 2907 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
2908 +//
2909 +// if (failure) {
2910 +// failure(errorToken);
2911 +// }
2908 2912
2913 + [self refreshToken:^(NSDictionary *response) {
2914 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
2915 + if (success) {
2916 + success(contextResponse);
2917 + }
2918 + } failureBlock:^(NSError *error) {
2909 if (failure) { 2919 if (failure) {
2910 - failure(errorToken); 2920 + failure(error);
2911 } 2921 }
2912 - 2922 + }];
2913 -// [self refreshToken:^(NSDictionary *response) { 2923 + } failureBlock:^(NSError *error) {
2914 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 2924 + if (failure) {
2915 -// if (success) { 2925 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2916 -// success(contextResponse); 2926 + failure(error);
2917 -// } 2927 + }
2918 -// } failureBlock:^(NSError *error) { 2928 + NSLog(@"Error at token %@", error );
2919 -// if (failure) { 2929 + }];
2920 -// failure(error);
2921 -// }
2922 -// }];
2923 -// } failureBlock:^(NSError *error) {
2924 -// if (failure) {
2925 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
2926 -// failure(error);
2927 -// }
2928 -// NSLog(@"Error at token %@", error );
2929 -// }];
2930 } else { 2930 } else {
2931 NSLog(@"Error at delete address %@", error ); 2931 NSLog(@"Error at delete address %@", error );
2932 failure(error); 2932 failure(error);
...@@ -2950,30 +2950,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2950,30 +2950,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2950 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 2950 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
2951 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 2951 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
2952 2952
2953 - NSString* errorDomain = [error domain]; 2953 +// NSString* errorDomain = [error domain];
2954 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 2954 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
2955 +//
2956 +// if (failure) {
2957 +// failure(errorToken);
2958 +// }
2955 2959
2960 + [self refreshToken:^(NSDictionary *response) {
2961 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
2962 + if (success) {
2963 + success(contextResponse);
2964 + }
2965 + } failureBlock:^(NSError *error) {
2956 if (failure) { 2966 if (failure) {
2957 - failure(errorToken); 2967 + failure(error);
2958 } 2968 }
2959 - 2969 + }];
2960 -// [self refreshToken:^(NSDictionary *response) { 2970 + } failureBlock:^(NSError *error) {
2961 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 2971 + if (failure) {
2962 -// if (success) { 2972 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2963 -// success(contextResponse); 2973 + failure(error);
2964 -// } 2974 + }
2965 -// } failureBlock:^(NSError *error) { 2975 + NSLog(@"Error at token %@", error );
2966 -// if (failure) { 2976 + }];
2967 -// failure(error);
2968 -// }
2969 -// }];
2970 -// } failureBlock:^(NSError *error) {
2971 -// if (failure) {
2972 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
2973 -// failure(error);
2974 -// }
2975 -// NSLog(@"Error at token %@", error );
2976 -// }];
2977 } else { 2977 } else {
2978 NSLog(@"Error at redeem coupons %@", error ); 2978 NSLog(@"Error at redeem coupons %@", error );
2979 failure(error); 2979 failure(error);
...@@ -3218,32 +3218,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -3218,32 +3218,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
3218 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 3218 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
3219 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 3219 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
3220 3220
3221 - NSString* errorDomain = [error domain]; 3221 +// NSString* errorDomain = [error domain];
3222 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 3222 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
3223 +//
3224 +// if (failure) {
3225 +// failure(errorToken);
3226 +// }
3223 3227
3228 + [self refreshToken:^(NSDictionary *response) {
3229 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
3230 + if (success) {
3231 + success(contextResponse);
3232 + }
3233 + NSLog(@"**************** WARPLY Response *****************" );
3234 + NSLog(@"%@", contextResponse );
3235 + } failureBlock:^(NSError *error) {
3224 if (failure) { 3236 if (failure) {
3225 - failure(errorToken); 3237 + failure(error);
3226 } 3238 }
3227 - 3239 + }];
3228 -// [self refreshToken:^(NSDictionary *response) { 3240 + } failureBlock:^(NSError *error) {
3229 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 3241 + if (failure) {
3230 -// if (success) { 3242 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
3231 -// success(contextResponse); 3243 + failure(error);
3232 -// } 3244 + }
3233 -// NSLog(@"**************** WARPLY Response *****************" ); 3245 + NSLog(@"Error at token %@", error );
3234 -// NSLog(@"%@", contextResponse ); 3246 + }];
3235 -// } failureBlock:^(NSError *error) {
3236 -// if (failure) {
3237 -// failure(error);
3238 -// }
3239 -// }];
3240 -// } failureBlock:^(NSError *error) {
3241 -// if (failure) {
3242 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
3243 -// failure(error);
3244 -// }
3245 -// NSLog(@"Error at token %@", error );
3246 -// }];
3247 } else { 3247 } else {
3248 NSLog(@"Error at redeem coupon sets %@", error ); 3248 NSLog(@"Error at redeem coupon sets %@", error );
3249 failure(error); 3249 failure(error);
...@@ -3288,32 +3288,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -3288,32 +3288,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
3288 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 3288 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
3289 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 3289 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
3290 3290
3291 - NSString* errorDomain = [error domain]; 3291 +// NSString* errorDomain = [error domain];
3292 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 3292 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
3293 +//
3294 +// if (failure) {
3295 +// failure(errorToken);
3296 +// }
3293 3297
3298 + [self refreshToken:^(NSDictionary *response) {
3299 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
3300 + if (success) {
3301 + success(contextResponse);
3302 + }
3303 + NSLog(@"**************** WARPLY Response *****************" );
3304 + NSLog(@"%@", contextResponse );
3305 + } failureBlock:^(NSError *error) {
3294 if (failure) { 3306 if (failure) {
3295 - failure(errorToken); 3307 + failure(error);
3296 } 3308 }
3297 - 3309 + }];
3298 -// [self refreshToken:^(NSDictionary *response) { 3310 + } failureBlock:^(NSError *error) {
3299 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 3311 + if (failure) {
3300 -// if (success) { 3312 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
3301 -// success(contextResponse); 3313 + failure(error);
3302 -// } 3314 + }
3303 -// NSLog(@"**************** WARPLY Response *****************" ); 3315 + NSLog(@"Error at token %@", error );
3304 -// NSLog(@"%@", contextResponse ); 3316 + }];
3305 -// } failureBlock:^(NSError *error) {
3306 -// if (failure) {
3307 -// failure(error);
3308 -// }
3309 -// }];
3310 -// } failureBlock:^(NSError *error) {
3311 -// if (failure) {
3312 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
3313 -// failure(error);
3314 -// }
3315 -// NSLog(@"Error at token %@", error );
3316 -// }];
3317 } else { 3317 } else {
3318 NSLog(@"Error at redeem coupon sets %@", error ); 3318 NSLog(@"Error at redeem coupon sets %@", error );
3319 failure(error); 3319 failure(error);
...@@ -3339,32 +3339,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -3339,32 +3339,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
3339 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 3339 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
3340 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 3340 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
3341 3341
3342 - NSString* errorDomain = [error domain]; 3342 +// NSString* errorDomain = [error domain];
3343 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 3343 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
3344 +//
3345 +// if (failure) {
3346 +// failure(errorToken);
3347 +// }
3344 3348
3349 + [self refreshToken:^(NSDictionary *response) {
3350 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
3351 + if (success) {
3352 + success(contextResponse);
3353 + }
3354 + NSLog(@"**************** WARPLY Response *****************" );
3355 + NSLog(@"%@", contextResponse );
3356 + } failureBlock:^(NSError *error) {
3345 if (failure) { 3357 if (failure) {
3346 - failure(errorToken); 3358 + failure(error);
3347 } 3359 }
3348 - 3360 + }];
3349 -// [self refreshToken:^(NSDictionary *response) { 3361 + } failureBlock:^(NSError *error) {
3350 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 3362 + if (failure) {
3351 -// if (success) { 3363 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
3352 -// success(contextResponse); 3364 + failure(error);
3353 -// } 3365 + }
3354 -// NSLog(@"**************** WARPLY Response *****************" ); 3366 + NSLog(@"Error at token %@", error );
3355 -// NSLog(@"%@", contextResponse ); 3367 + }];
3356 -// } failureBlock:^(NSError *error) {
3357 -// if (failure) {
3358 -// failure(error);
3359 -// }
3360 -// }];
3361 -// } failureBlock:^(NSError *error) {
3362 -// if (failure) {
3363 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
3364 -// failure(error);
3365 -// }
3366 -// NSLog(@"Error at token %@", error );
3367 -// }];
3368 } else { 3368 } else {
3369 NSLog(@"Error at cosmote Coupon Sharing %@", error ); 3369 NSLog(@"Error at cosmote Coupon Sharing %@", error );
3370 failure(error); 3370 failure(error);
...@@ -3390,32 +3390,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -3390,32 +3390,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
3390 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 3390 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
3391 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 3391 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
3392 3392
3393 - NSString* errorDomain = [error domain]; 3393 +// NSString* errorDomain = [error domain];
3394 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 3394 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
3395 +//
3396 +// if (failure) {
3397 +// failure(errorToken);
3398 +// }
3395 3399
3400 + [self refreshToken:^(NSDictionary *response) {
3401 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
3402 + if (success) {
3403 + success(contextResponse);
3404 + }
3405 + NSLog(@"**************** WARPLY Response *****************" );
3406 + NSLog(@"%@", contextResponse );
3407 + } failureBlock:^(NSError *error) {
3396 if (failure) { 3408 if (failure) {
3397 - failure(errorToken); 3409 + failure(error);
3398 } 3410 }
3399 - 3411 + }];
3400 -// [self refreshToken:^(NSDictionary *response) { 3412 + } failureBlock:^(NSError *error) {
3401 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 3413 + if (failure) {
3402 -// if (success) { 3414 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
3403 -// success(contextResponse); 3415 + failure(error);
3404 -// } 3416 + }
3405 -// NSLog(@"**************** WARPLY Response *****************" ); 3417 + NSLog(@"Error at token %@", error );
3406 -// NSLog(@"%@", contextResponse ); 3418 + }];
3407 -// } failureBlock:^(NSError *error) {
3408 -// if (failure) {
3409 -// failure(error);
3410 -// }
3411 -// }];
3412 -// } failureBlock:^(NSError *error) {
3413 -// if (failure) {
3414 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
3415 -// failure(error);
3416 -// }
3417 -// NSLog(@"Error at token %@", error );
3418 -// }];
3419 } else { 3419 } else {
3420 NSLog(@"Error at get cosmote sharing %@", error ); 3420 NSLog(@"Error at get cosmote sharing %@", error );
3421 failure(error); 3421 failure(error);
...@@ -3441,32 +3441,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -3441,32 +3441,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
3441 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 3441 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
3442 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 3442 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
3443 3443
3444 - NSString* errorDomain = [error domain]; 3444 +// NSString* errorDomain = [error domain];
3445 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 3445 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
3446 +//
3447 +// if (failure) {
3448 +// failure(errorToken);
3449 +// }
3446 3450
3451 + [self refreshToken:^(NSDictionary *response) {
3452 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
3453 + if (success) {
3454 + success(contextResponse);
3455 + }
3456 + NSLog(@"**************** WARPLY Response *****************" );
3457 + NSLog(@"%@", contextResponse );
3458 + } failureBlock:^(NSError *error) {
3447 if (failure) { 3459 if (failure) {
3448 - failure(errorToken); 3460 + failure(error);
3449 } 3461 }
3450 - 3462 + }];
3451 -// [self refreshToken:^(NSDictionary *response) { 3463 + } failureBlock:^(NSError *error) {
3452 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 3464 + if (failure) {
3453 -// if (success) { 3465 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
3454 -// success(contextResponse); 3466 + failure(error);
3455 -// } 3467 + }
3456 -// NSLog(@"**************** WARPLY Response *****************" ); 3468 + NSLog(@"Error at token %@", error );
3457 -// NSLog(@"%@", contextResponse ); 3469 + }];
3458 -// } failureBlock:^(NSError *error) {
3459 -// if (failure) {
3460 -// failure(error);
3461 -// }
3462 -// }];
3463 -// } failureBlock:^(NSError *error) {
3464 -// if (failure) {
3465 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
3466 -// failure(error);
3467 -// }
3468 -// NSLog(@"Error at token %@", error );
3469 -// }];
3470 } else { 3470 } else {
3471 NSLog(@"Error at cosmote retrieve sharing %@", error ); 3471 NSLog(@"Error at cosmote retrieve sharing %@", error );
3472 failure(error); 3472 failure(error);
...@@ -3511,32 +3511,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -3511,32 +3511,32 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
3511 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 3511 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
3512 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 3512 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
3513 3513
3514 - NSString* errorDomain = [error domain]; 3514 +// NSString* errorDomain = [error domain];
3515 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 3515 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
3516 +//
3517 +// if (failure) {
3518 +// failure(errorToken);
3519 +// }
3516 3520
3521 + [self refreshToken:^(NSDictionary *response) {
3522 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
3523 + if (success) {
3524 + success(contextResponse);
3525 + }
3526 + NSLog(@"**************** WARPLY Response *****************" );
3527 + NSLog(@"%@", contextResponse );
3528 + } failureBlock:^(NSError *error) {
3517 if (failure) { 3529 if (failure) {
3518 - failure(errorToken); 3530 + failure(error);
3519 } 3531 }
3520 - 3532 + }];
3521 -// [self refreshToken:^(NSDictionary *response) { 3533 + } failureBlock:^(NSError *error) {
3522 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 3534 + if (failure) {
3523 -// if (success) { 3535 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
3524 -// success(contextResponse); 3536 + failure(error);
3525 -// } 3537 + }
3526 -// NSLog(@"**************** WARPLY Response *****************" ); 3538 + NSLog(@"Error at token %@", error );
3527 -// NSLog(@"%@", contextResponse ); 3539 + }];
3528 -// } failureBlock:^(NSError *error) {
3529 -// if (failure) {
3530 -// failure(error);
3531 -// }
3532 -// }];
3533 -// } failureBlock:^(NSError *error) {
3534 -// if (failure) {
3535 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
3536 -// failure(error);
3537 -// }
3538 -// NSLog(@"Error at token %@", error );
3539 -// }];
3540 } else { 3540 } else {
3541 NSLog(@"Error at submit Order %@", error ); 3541 NSLog(@"Error at submit Order %@", error );
3542 failure(error); 3542 failure(error);
...@@ -3560,30 +3560,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -3560,30 +3560,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
3560 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 3560 NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
3561 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 3561 if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
3562 3562
3563 - NSString* errorDomain = [error domain]; 3563 +// NSString* errorDomain = [error domain];
3564 - NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict]; 3564 +// NSError *errorToken = [NSError errorWithDomain:errorDomain code:401 userInfo:dict];
3565 +//
3566 +// if (failure) {
3567 +// failure(errorToken);
3568 +// }
3565 3569
3570 + [self refreshToken:^(NSDictionary *response) {
3571 + [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) {
3572 + if (success) {
3573 + success(contextResponse);
3574 + }
3575 + } failureBlock:^(NSError *error) {
3566 if (failure) { 3576 if (failure) {
3567 - failure(errorToken); 3577 + failure(error);
3568 } 3578 }
3569 - 3579 + }];
3570 -// [self refreshToken:^(NSDictionary *response) { 3580 + } failureBlock:^(NSError *error) {
3571 -// [self sendContext8:jsonData successBlock:^(NSDictionary *contextResponse) { 3581 + if (failure) {
3572 -// if (success) { 3582 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
3573 -// success(contextResponse); 3583 + failure(error);
3574 -// } 3584 + }
3575 -// } failureBlock:^(NSError *error) { 3585 + NSLog(@"Error at token %@", error );
3576 -// if (failure) { 3586 + }];
3577 -// failure(error);
3578 -// }
3579 -// }];
3580 -// } failureBlock:^(NSError *error) {
3581 -// if (failure) {
3582 -// // [_db executeUpdate:@"DROP TABLE requestVariables"];
3583 -// failure(error);
3584 -// }
3585 -// NSLog(@"Error at token %@", error );
3586 -// }];
3587 } else { 3587 } else {
3588 NSLog(@"Error at get coupon sets %@", error ); 3588 NSLog(@"Error at get coupon sets %@", error );
3589 failure(error); 3589 failure(error);
......
...@@ -732,11 +732,11 @@ public class swiftApi { ...@@ -732,11 +732,11 @@ public class swiftApi {
732 SwiftEventBus.post("dynatrace", sender: dynatraceEvent) 732 SwiftEventBus.post("dynatrace", sender: dynatraceEvent)
733 733
734 if let error = error as? NSError { 734 if let error = error as? NSError {
735 - if (error.code == 401) { 735 +// if (error.code == 401) {
736 - let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel() 736 +// let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel()
737 - sessionEvent._sessionExpired = true 737 +// sessionEvent._sessionExpired = true
738 - SwiftEventBus.post("sdk_session_expired", sender: sessionEvent) 738 +// SwiftEventBus.post("sdk_session_expired", sender: sessionEvent)
739 - } 739 +// }
740 740
741 failureCallback(error.code) 741 failureCallback(error.code)
742 } else { 742 } else {
...@@ -1400,11 +1400,11 @@ public class swiftApi { ...@@ -1400,11 +1400,11 @@ public class swiftApi {
1400 SwiftEventBus.post("dynatrace", sender: dynatraceEvent) 1400 SwiftEventBus.post("dynatrace", sender: dynatraceEvent)
1401 1401
1402 if let error = error as? NSError { 1402 if let error = error as? NSError {
1403 - if (error.code == 401) { 1403 +// if (error.code == 401) {
1404 - let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel() 1404 +// let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel()
1405 - sessionEvent._sessionExpired = true 1405 +// sessionEvent._sessionExpired = true
1406 - SwiftEventBus.post("sdk_session_expired", sender: sessionEvent) 1406 +// SwiftEventBus.post("sdk_session_expired", sender: sessionEvent)
1407 - } 1407 +// }
1408 1408
1409 failureCallback(error.code) 1409 failureCallback(error.code)
1410 } else { 1410 } else {
...@@ -2442,11 +2442,11 @@ public class swiftApi { ...@@ -2442,11 +2442,11 @@ public class swiftApi {
2442 SwiftEventBus.post("dynatrace", sender: dynatraceEvent) 2442 SwiftEventBus.post("dynatrace", sender: dynatraceEvent)
2443 2443
2444 if let error = error as? NSError { 2444 if let error = error as? NSError {
2445 - if (error.code == 401) { 2445 +// if (error.code == 401) {
2446 - let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel() 2446 +// let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel()
2447 - sessionEvent._sessionExpired = true 2447 +// sessionEvent._sessionExpired = true
2448 - SwiftEventBus.post("sdk_session_expired", sender: sessionEvent) 2448 +// SwiftEventBus.post("sdk_session_expired", sender: sessionEvent)
2449 - } 2449 +// }
2450 2450
2451 failureCallback(error.code) 2451 failureCallback(error.code)
2452 } else { 2452 } else {
...@@ -4061,11 +4061,11 @@ public class swiftApi { ...@@ -4061,11 +4061,11 @@ public class swiftApi {
4061 print("====================") 4061 print("====================")
4062 4062
4063 if let error = error as? NSError { 4063 if let error = error as? NSError {
4064 - if (error.code == 401) { 4064 +// if (error.code == 401) {
4065 - let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel() 4065 +// let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel()
4066 - sessionEvent._sessionExpired = true 4066 +// sessionEvent._sessionExpired = true
4067 - SwiftEventBus.post("sdk_session_expired", sender: sessionEvent) 4067 +// SwiftEventBus.post("sdk_session_expired", sender: sessionEvent)
4068 - } 4068 +// }
4069 4069
4070 failureCallback(error.code) 4070 failureCallback(error.code)
4071 } else { 4071 } else {
...@@ -4099,11 +4099,11 @@ public class swiftApi { ...@@ -4099,11 +4099,11 @@ public class swiftApi {
4099 print("====================") 4099 print("====================")
4100 4100
4101 if let error = error as? NSError { 4101 if let error = error as? NSError {
4102 - if (error.code == 401) { 4102 +// if (error.code == 401) {
4103 - let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel() 4103 +// let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel()
4104 - sessionEvent._sessionExpired = true 4104 +// sessionEvent._sessionExpired = true
4105 - SwiftEventBus.post("sdk_session_expired", sender: sessionEvent) 4105 +// SwiftEventBus.post("sdk_session_expired", sender: sessionEvent)
4106 - } 4106 +// }
4107 4107
4108 failureCallback(error.code) 4108 failureCallback(error.code)
4109 } else { 4109 } else {
...@@ -4138,11 +4138,11 @@ public class swiftApi { ...@@ -4138,11 +4138,11 @@ public class swiftApi {
4138 print("====================") 4138 print("====================")
4139 4139
4140 if let error = error as? NSError { 4140 if let error = error as? NSError {
4141 - if (error.code == 401) { 4141 +// if (error.code == 401) {
4142 - let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel() 4142 +// let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel()
4143 - sessionEvent._sessionExpired = true 4143 +// sessionEvent._sessionExpired = true
4144 - SwiftEventBus.post("sdk_session_expired", sender: sessionEvent) 4144 +// SwiftEventBus.post("sdk_session_expired", sender: sessionEvent)
4145 - } 4145 +// }
4146 4146
4147 failureCallback(error.code) 4147 failureCallback(error.code)
4148 } else { 4148 } else {
...@@ -4782,11 +4782,11 @@ public class swiftApi { ...@@ -4782,11 +4782,11 @@ public class swiftApi {
4782 print("getPacingDetails error: ") 4782 print("getPacingDetails error: ")
4783 4783
4784 if let error = error as? NSError { 4784 if let error = error as? NSError {
4785 - if (error.code == 401) { 4785 +// if (error.code == 401) {
4786 - let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel() 4786 +// let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel()
4787 - sessionEvent._sessionExpired = true 4787 +// sessionEvent._sessionExpired = true
4788 - SwiftEventBus.post("sdk_session_expired", sender: sessionEvent) 4788 +// SwiftEventBus.post("sdk_session_expired", sender: sessionEvent)
4789 - } 4789 +// }
4790 4790
4791 failureCallback(error.code) 4791 failureCallback(error.code)
4792 } else { 4792 } else {
...@@ -4851,11 +4851,11 @@ public class swiftApi { ...@@ -4851,11 +4851,11 @@ public class swiftApi {
4851 print("setPacingDetails error: ") 4851 print("setPacingDetails error: ")
4852 4852
4853 if let error = error as? NSError { 4853 if let error = error as? NSError {
4854 - if (error.code == 401) { 4854 +// if (error.code == 401) {
4855 - let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel() 4855 +// let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel()
4856 - sessionEvent._sessionExpired = true 4856 +// sessionEvent._sessionExpired = true
4857 - SwiftEventBus.post("sdk_session_expired", sender: sessionEvent) 4857 +// SwiftEventBus.post("sdk_session_expired", sender: sessionEvent)
4858 - } 4858 +// }
4859 4859
4860 failureCallback(error.code) 4860 failureCallback(error.code)
4861 } else { 4861 } else {
...@@ -4975,11 +4975,11 @@ public class swiftApi { ...@@ -4975,11 +4975,11 @@ public class swiftApi {
4975 SwiftEventBus.post("dynatrace", sender: dynatraceEvent) 4975 SwiftEventBus.post("dynatrace", sender: dynatraceEvent)
4976 4976
4977 if let error = error as? NSError { 4977 if let error = error as? NSError {
4978 - if (error.code == 401) { 4978 +// if (error.code == 401) {
4979 - let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel() 4979 +// let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel()
4980 - sessionEvent._sessionExpired = true 4980 +// sessionEvent._sessionExpired = true
4981 - SwiftEventBus.post("sdk_session_expired", sender: sessionEvent) 4981 +// SwiftEventBus.post("sdk_session_expired", sender: sessionEvent)
4982 - } 4982 +// }
4983 4983
4984 failureCallback(error.code) 4984 failureCallback(error.code)
4985 } else { 4985 } else {
...@@ -5044,11 +5044,11 @@ public class swiftApi { ...@@ -5044,11 +5044,11 @@ public class swiftApi {
5044 SwiftEventBus.post("dynatrace", sender: dynatraceEvent) 5044 SwiftEventBus.post("dynatrace", sender: dynatraceEvent)
5045 5045
5046 if let error = error as? NSError { 5046 if let error = error as? NSError {
5047 - if (error.code == 401) { 5047 +// if (error.code == 401) {
5048 - let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel() 5048 +// let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel()
5049 - sessionEvent._sessionExpired = true 5049 +// sessionEvent._sessionExpired = true
5050 - SwiftEventBus.post("sdk_session_expired", sender: sessionEvent) 5050 +// SwiftEventBus.post("sdk_session_expired", sender: sessionEvent)
5051 - } 5051 +// }
5052 5052
5053 failureCallback(error.code) 5053 failureCallback(error.code)
5054 } else { 5054 } else {
...@@ -5157,11 +5157,11 @@ public class swiftApi { ...@@ -5157,11 +5157,11 @@ public class swiftApi {
5157 SwiftEventBus.post("dynatrace", sender: dynatraceEvent) 5157 SwiftEventBus.post("dynatrace", sender: dynatraceEvent)
5158 5158
5159 if let error = error as? NSError { 5159 if let error = error as? NSError {
5160 - if (error.code == 401) { 5160 +// if (error.code == 401) {
5161 - let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel() 5161 +// let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel()
5162 - sessionEvent._sessionExpired = true 5162 +// sessionEvent._sessionExpired = true
5163 - SwiftEventBus.post("sdk_session_expired", sender: sessionEvent) 5163 +// SwiftEventBus.post("sdk_session_expired", sender: sessionEvent)
5164 - } 5164 +// }
5165 5165
5166 failureCallback(error.code) 5166 failureCallback(error.code)
5167 } else { 5167 } else {
...@@ -5229,11 +5229,11 @@ public class swiftApi { ...@@ -5229,11 +5229,11 @@ public class swiftApi {
5229 SwiftEventBus.post("dynatrace", sender: dynatraceEvent) 5229 SwiftEventBus.post("dynatrace", sender: dynatraceEvent)
5230 5230
5231 if let error = error as? NSError { 5231 if let error = error as? NSError {
5232 - if (error.code == 401) { 5232 +// if (error.code == 401) {
5233 - let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel() 5233 +// let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel()
5234 - sessionEvent._sessionExpired = true 5234 +// sessionEvent._sessionExpired = true
5235 - SwiftEventBus.post("sdk_session_expired", sender: sessionEvent) 5235 +// SwiftEventBus.post("sdk_session_expired", sender: sessionEvent)
5236 - } 5236 +// }
5237 5237
5238 failureCallback(error.code) 5238 failureCallback(error.code)
5239 } else { 5239 } else {
...@@ -5301,11 +5301,11 @@ public class swiftApi { ...@@ -5301,11 +5301,11 @@ public class swiftApi {
5301 SwiftEventBus.post("dynatrace", sender: dynatraceEvent) 5301 SwiftEventBus.post("dynatrace", sender: dynatraceEvent)
5302 5302
5303 if let error = error as? NSError { 5303 if let error = error as? NSError {
5304 - if (error.code == 401) { 5304 +// if (error.code == 401) {
5305 - let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel() 5305 +// let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel()
5306 - sessionEvent._sessionExpired = true 5306 +// sessionEvent._sessionExpired = true
5307 - SwiftEventBus.post("sdk_session_expired", sender: sessionEvent) 5307 +// SwiftEventBus.post("sdk_session_expired", sender: sessionEvent)
5308 - } 5308 +// }
5309 5309
5310 failureCallback(error.code) 5310 failureCallback(error.code)
5311 } else { 5311 } else {
...@@ -5558,11 +5558,11 @@ public class swiftApi { ...@@ -5558,11 +5558,11 @@ public class swiftApi {
5558 SwiftEventBus.post("dynatrace", sender: dynatraceEvent) 5558 SwiftEventBus.post("dynatrace", sender: dynatraceEvent)
5559 5559
5560 if let error = error as? NSError { 5560 if let error = error as? NSError {
5561 - if (error.code == 401) { 5561 +// if (error.code == 401) {
5562 - let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel() 5562 +// let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel()
5563 - sessionEvent._sessionExpired = true 5563 +// sessionEvent._sessionExpired = true
5564 - SwiftEventBus.post("sdk_session_expired", sender: sessionEvent) 5564 +// SwiftEventBus.post("sdk_session_expired", sender: sessionEvent)
5565 - } 5565 +// }
5566 5566
5567 failureCallback(error.code) 5567 failureCallback(error.code)
5568 } else { 5568 } else {
...@@ -6553,11 +6553,11 @@ public class swiftApi { ...@@ -6553,11 +6553,11 @@ public class swiftApi {
6553 SwiftEventBus.post("dynatrace", sender: dynatraceEvent) 6553 SwiftEventBus.post("dynatrace", sender: dynatraceEvent)
6554 6554
6555 if let error = error as? NSError { 6555 if let error = error as? NSError {
6556 - if (error.code == 401) { 6556 +// if (error.code == 401) {
6557 - let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel() 6557 +// let sessionEvent = swiftApi.LoyaltySDKSessionExpiredEventModel()
6558 - sessionEvent._sessionExpired = true 6558 +// sessionEvent._sessionExpired = true
6559 - SwiftEventBus.post("sdk_session_expired", sender: sessionEvent) 6559 +// SwiftEventBus.post("sdk_session_expired", sender: sessionEvent)
6560 - } 6560 +// }
6561 6561
6562 failureCallback(error.code) 6562 failureCallback(error.code)
6563 } else { 6563 } else {
......