Manos Chorianopoulos

fix texts, add accessToken logs at logout

...@@ -113,6 +113,7 @@ ...@@ -113,6 +113,7 @@
113 - (void)getSingleCampaignAsync:(NSString*)sessionUuid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 113 - (void)getSingleCampaignAsync:(NSString*)sessionUuid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
114 - (void) sendEvent: (NSString *) eventName priority: (BOOL) priority; 114 - (void) sendEvent: (NSString *) eventName priority: (BOOL) priority;
115 - (void)updateRefreshTokenMA:(NSString*)access_token :(NSString*)refresh_token; 115 - (void)updateRefreshTokenMA:(NSString*)access_token :(NSString*)refresh_token;
116 +- (NSString*)getAccessTokenM;
116 117
117 @end 118 @end
118 #endif /* MyApi_h */ 119 #endif /* MyApi_h */
......
...@@ -1794,4 +1794,11 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify"; ...@@ -1794,4 +1794,11 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify";
1794 [[Warply sharedService] updateRefreshTokenW:access_token :refresh_token]; 1794 [[Warply sharedService] updateRefreshTokenW:access_token :refresh_token];
1795 } 1795 }
1796 1796
1797 +///////////////////////////////////////////////////////////////////////////////////////////////////
1798 +- (NSString*)getAccessTokenM
1799 +{
1800 +
1801 + return [[Warply sharedService] getAccessToken2];
1802 +}
1803 +
1797 @end 1804 @end
......
...@@ -293,6 +293,8 @@ WL_VERSION_INTERFACE() ...@@ -293,6 +293,8 @@ WL_VERSION_INTERFACE()
293 */ 293 */
294 - (NSString*)getAccessToken; 294 - (NSString*)getAccessToken;
295 295
296 +- (NSString*)getAccessToken2;
297 +
296 - (NSString*)getRefreshToken; 298 - (NSString*)getRefreshToken;
297 299
298 - (NSString*)getClientId; 300 - (NSString*)getClientId;
......
...@@ -755,6 +755,47 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -755,6 +755,47 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
755 return @""; 755 return @"";
756 }; 756 };
757 757
758 +- (NSString*)getAccessToken2 {
759 + BOOL tableExist = NO;
760 + @try {
761 + @synchronized (_DatabaseLock) {
762 + tableExist = [_db tableExists:@"requestVariables"];
763 + }
764 + }
765 + @catch (NSException *exception) {
766 + NSLog(@"tableExists error: %@", exception.reason);
767 + }
768 + @finally {
769 +// NSLog(@"Finally condition");
770 + }
771 +// NSString *accessToken = [NSString alloc];
772 + NSString *accessToken = @"";
773 + if (tableExist == YES) {
774 + @try {
775 + @synchronized (_DatabaseLock) {
776 + FMResultSet *accessTokenSet = [_db executeQuery:@"SELECT access_token FROM requestVariables WHERE id = 1;"];
777 + while ([accessTokenSet next]) {
778 + accessToken = [[accessTokenSet resultDictionary][@"access_token"] stringValue];
779 + }
780 + }
781 + }
782 + @catch (NSException *exception) {
783 + NSLog(@"SELECT accessToken error: %@", exception.reason);
784 + accessToken = @"";
785 + }
786 + @finally {
787 +// NSLog(@"Finally condition");
788 + }
789 +
790 + // FMResultSet *accessTokenSet = [_db executeQuery:@"SELECT access_token FROM requestVariables WHERE id = 1;"];
791 + // while ([accessTokenSet next]) {
792 + // accessToken = [[accessTokenSet resultDictionary][@"access_token"] stringValue];
793 + // }
794 + return accessToken;
795 + }
796 + return @"";
797 +};
798 +
758 - (NSString*)getRefreshToken { 799 - (NSString*)getRefreshToken {
759 800
760 BOOL tableExist = NO; 801 BOOL tableExist = NO;
......
...@@ -6354,6 +6354,11 @@ public class swiftApi { ...@@ -6354,6 +6354,11 @@ public class swiftApi {
6354 swiftApi().setUserTag("") 6354 swiftApi().setUserTag("")
6355 swiftApi().setUserNonTelco(false) 6355 swiftApi().setUserNonTelco(false)
6356 swiftApi().setCCMSLoyaltyCampaigns(campaigns: []) 6356 swiftApi().setCCMSLoyaltyCampaigns(campaigns: [])
6357 +
6358 + let accessToken = instanceOfMyApi.getAccessTokenM()
6359 + print("=================== TOKEN DELETED =========================")
6360 + print("Bearer: ", accessToken)
6361 + print("=================== TOKEN DELETED =========================")
6357 } else { 6362 } else {
6358 6363
6359 let dynatraceEvent = swiftApi.LoyaltySDKDynatraceEventModel() 6364 let dynatraceEvent = swiftApi.LoyaltySDKDynatraceEventModel()
......