Manos Chorianopoulos

fix texts, add accessToken logs at logout

......@@ -113,6 +113,7 @@
- (void)getSingleCampaignAsync:(NSString*)sessionUuid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void) sendEvent: (NSString *) eventName priority: (BOOL) priority;
- (void)updateRefreshTokenMA:(NSString*)access_token :(NSString*)refresh_token;
- (NSString*)getAccessTokenM;
@end
#endif /* MyApi_h */
......
......@@ -1794,4 +1794,11 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify";
[[Warply sharedService] updateRefreshTokenW:access_token :refresh_token];
}
///////////////////////////////////////////////////////////////////////////////////////////////////
- (NSString*)getAccessTokenM
{
return [[Warply sharedService] getAccessToken2];
}
@end
......
......@@ -293,6 +293,8 @@ WL_VERSION_INTERFACE()
*/
- (NSString*)getAccessToken;
- (NSString*)getAccessToken2;
- (NSString*)getRefreshToken;
- (NSString*)getClientId;
......
......@@ -755,6 +755,47 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
return @"";
};
- (NSString*)getAccessToken2 {
BOOL tableExist = NO;
@try {
@synchronized (_DatabaseLock) {
tableExist = [_db tableExists:@"requestVariables"];
}
}
@catch (NSException *exception) {
NSLog(@"tableExists error: %@", exception.reason);
}
@finally {
// NSLog(@"Finally condition");
}
// NSString *accessToken = [NSString alloc];
NSString *accessToken = @"";
if (tableExist == YES) {
@try {
@synchronized (_DatabaseLock) {
FMResultSet *accessTokenSet = [_db executeQuery:@"SELECT access_token FROM requestVariables WHERE id = 1;"];
while ([accessTokenSet next]) {
accessToken = [[accessTokenSet resultDictionary][@"access_token"] stringValue];
}
}
}
@catch (NSException *exception) {
NSLog(@"SELECT accessToken error: %@", exception.reason);
accessToken = @"";
}
@finally {
// NSLog(@"Finally condition");
}
// FMResultSet *accessTokenSet = [_db executeQuery:@"SELECT access_token FROM requestVariables WHERE id = 1;"];
// while ([accessTokenSet next]) {
// accessToken = [[accessTokenSet resultDictionary][@"access_token"] stringValue];
// }
return accessToken;
}
return @"";
};
- (NSString*)getRefreshToken {
BOOL tableExist = NO;
......
......@@ -6354,6 +6354,11 @@ public class swiftApi {
swiftApi().setUserTag("")
swiftApi().setUserNonTelco(false)
swiftApi().setCCMSLoyaltyCampaigns(campaigns: [])
let accessToken = instanceOfMyApi.getAccessTokenM()
print("=================== TOKEN DELETED =========================")
print("Bearer: ", accessToken)
print("=================== TOKEN DELETED =========================")
} else {
let dynatraceEvent = swiftApi.LoyaltySDKDynatraceEventModel()
......