Commit 6088b9ea authored by Kevin Reynaldo's avatar Kevin Reynaldo
Browse files

• Updated version to 1.3.0

• Added no internet connection error message to login/register API
• Fixed encryptor manager crash
parent 7d289a83
......@@ -3,7 +3,7 @@ Pod::Spec.new do |s|
# ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.name = "TapTalk"
s.version = "1.2.18"
s.version = "1.3.0"
s.summary = "TapTalk.io is a complete in-app chat SDK and messaging API. TapTalk.io provides UI-based and code-based implementation & fully customizable."
s.homepage = "https://taptalk.io"
......
......@@ -2153,7 +2153,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.2.18;
MARKETING_VERSION = 1.3.0;
PRODUCT_BUNDLE_IDENTIFIER = io.TapTalk.TapTalk;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
......@@ -2190,7 +2190,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.2.18;
MARKETING_VERSION = 1.3.0;
PRODUCT_BUNDLE_IDENTIFIER = io.TapTalk.TapTalk;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
......
......@@ -4685,6 +4685,17 @@
} failure:^(NSURLSessionDataTask *dataTask, NSError *error) {
[TAPDataManager logErrorStringFromError:error];
if (error.code == 199) {
//AS NOTE - NO INTERNET CONNECTION
NSString *errorDomain = error.domain;
NSString *newDomain = [NSString stringWithFormat:@"%@", errorDomain];
NSError *newError = [NSError errorWithDomain:newDomain code:error.code userInfo:error.userInfo];
failure(newError);
return;
}
else {
#ifdef DEBUG
NSString *errorDomain = error.domain;
NSString *newDomain = [NSString stringWithFormat:@"%@ ~ %@", requestURL, errorDomain];
......@@ -4696,6 +4707,7 @@
NSError *localizedError = [NSError errorWithDomain:NSLocalizedStringFromTableInBundle(@"We are experiencing problem to connect to our server, please try again later...", nil, [TAPUtil currentBundle], @"") code:999 userInfo:@{@"message": NSLocalizedStringFromTableInBundle(@"Failed to connect to our server, please try again later...", nil, [TAPUtil currentBundle], @"")}];
failure(localizedError);
#endif
}
}];
}
......@@ -4930,6 +4942,17 @@
} failure:^(NSURLSessionDataTask *dataTask, NSError *error) {
[TAPDataManager logErrorStringFromError:error];
if (error.code == 199) {
//AS NOTE - NO INTERNET CONNECTION
NSString *errorDomain = error.domain;
NSString *newDomain = [NSString stringWithFormat:@"%@", errorDomain];
NSError *newError = [NSError errorWithDomain:newDomain code:error.code userInfo:error.userInfo];
failure(newError);
return;
}
else {
#ifdef DEBUG
NSString *errorDomain = error.domain;
NSString *newDomain = [NSString stringWithFormat:@"%@ ~ %@", requestURL, errorDomain];
......@@ -4941,6 +4964,7 @@
NSError *localizedError = [NSError errorWithDomain:NSLocalizedStringFromTableInBundle(@"We are experiencing problem to connect to our server, please try again later...", nil, [TAPUtil currentBundle], @"") code:999 userInfo:@{@"message": NSLocalizedStringFromTableInBundle(@"Failed to connect to our server, please try again later...", nil, [TAPUtil currentBundle], @"")}];
failure(localizedError);
#endif
}
}];
}
......
......@@ -83,6 +83,10 @@ static NSString * const kKeyPasswordEncryptor = @"kHT0sVGIKKpnlJE5BNkINYtuf19u6+
NSInteger randomNumber = 1 + (arc4random() % 9); //Random number from 1 - 9
NSInteger encryptedStringLength = [encryptedString length];
if (encryptedStringLength <= 0) {
return nil;
}
NSInteger saltCharIndexPosition = (((encryptedStringLength + randomNumber) * randomNumber) % encryptedStringLength);
NSMutableString *encryptedStringWithSalt = [NSMutableString stringWithString:encryptedString];
......
......@@ -10,6 +10,8 @@
@import AFNetworking;
#define NETWORK_MANAGER_NO_CONNECTION_NOTIFICATION_KEY @"Prefs.NetworkManagerNoConnectionNotificationKey"
#define NETWORK_MANAGER_NO_CONNECTION_MESSAGE NSLocalizedStringFromTableInBundle(@"Oops! It seems like you are offline, please check your connection.", nil, [TAPUtil currentBundle], @"");
#define NETWORK_MANAGER_NO_CONNECTION_MESSAGE_OLD NSLocalizedStringFromTableInBundle(@"It appears you don't have internet connection, please try again later...", nil, [TAPUtil currentBundle], @"");
@interface TAPNetworkManager : NSObject
......
......@@ -124,7 +124,7 @@ static const NSInteger kAPITimeOut = 60;
//No internet connection notification
[[NSNotificationCenter defaultCenter] postNotificationName:NETWORK_MANAGER_NO_CONNECTION_NOTIFICATION_KEY object:nil];
NSString *errorMessage = NSLocalizedStringFromTableInBundle(@"It appears you don't have internet connection, please try again later...", nil, [TAPUtil currentBundle], @"");
NSString *errorMessage = NETWORK_MANAGER_NO_CONNECTION_MESSAGE;
NSError *error = [NSError errorWithDomain:errorMessage code:199 userInfo:@{@"message": errorMessage}];
failure (nil, error);
......@@ -161,7 +161,7 @@ static const NSInteger kAPITimeOut = 60;
//No internet connection notification
[[NSNotificationCenter defaultCenter] postNotificationName:NETWORK_MANAGER_NO_CONNECTION_NOTIFICATION_KEY object:nil];
NSString *errorMessage = NSLocalizedStringFromTableInBundle(@"It appears you don't have internet connection, please try again later...", nil, [TAPUtil currentBundle], @"");
NSString *errorMessage = NETWORK_MANAGER_NO_CONNECTION_MESSAGE;
NSError *error = [NSError errorWithDomain:errorMessage code:199 userInfo:@{@"message": errorMessage}];
failure (nil, error);
......@@ -300,7 +300,7 @@ static const NSInteger kAPITimeOut = 60;
//No internet connection notification
[[NSNotificationCenter defaultCenter] postNotificationName:NETWORK_MANAGER_NO_CONNECTION_NOTIFICATION_KEY object:nil];
NSString *errorMessage = NSLocalizedStringFromTableInBundle(@"It appears you don't have internet connection, please try again later...", nil, [TAPUtil currentBundle], @"");
NSString *errorMessage = NETWORK_MANAGER_NO_CONNECTION_MESSAGE;
NSError *error = [NSError errorWithDomain:errorMessage code:199 userInfo:@{@"message": errorMessage}];
failure (nil, error);
......@@ -342,7 +342,7 @@ refreshToken:(NSString *)refreshToken
//No internet connection notification
[[NSNotificationCenter defaultCenter] postNotificationName:NETWORK_MANAGER_NO_CONNECTION_NOTIFICATION_KEY object:nil];
NSString *errorMessage = NSLocalizedStringFromTableInBundle(@"It appears you don't have internet connection, please try again later...", nil, [TAPUtil currentBundle], @"");
NSString *errorMessage = NETWORK_MANAGER_NO_CONNECTION_MESSAGE;
NSError *error = [NSError errorWithDomain:errorMessage code:199 userInfo:@{@"message": errorMessage}];
failure (nil, error);
......@@ -391,7 +391,7 @@ refreshToken:(NSString *)refreshToken
//No internet connection notification
[[NSNotificationCenter defaultCenter] postNotificationName:NETWORK_MANAGER_NO_CONNECTION_NOTIFICATION_KEY object:nil];
NSString *errorMessage = NSLocalizedStringFromTableInBundle(@"It appears you don't have internet connection, please try again later...", nil, [TAPUtil currentBundle], @"");
NSString *errorMessage = NETWORK_MANAGER_NO_CONNECTION_MESSAGE;
NSError *error = [NSError errorWithDomain:errorMessage code:199 userInfo:@{@"message": errorMessage}];
failure (error);
......@@ -505,7 +505,7 @@ refreshToken:(NSString *)refreshToken
//No internet connection notification
[[NSNotificationCenter defaultCenter] postNotificationName:NETWORK_MANAGER_NO_CONNECTION_NOTIFICATION_KEY object:nil];
NSString *errorMessage = NSLocalizedStringFromTableInBundle(@"It appears you don't have internet connection, please try again later...", nil, [TAPUtil currentBundle], @"");
NSString *errorMessage = NETWORK_MANAGER_NO_CONNECTION_MESSAGE;
NSError *error = [NSError errorWithDomain:errorMessage code:199 userInfo:@{@"message": errorMessage}];
failure (error);
......@@ -585,7 +585,7 @@ refreshToken:(NSString *)refreshToken
//No internet connection notification
[[NSNotificationCenter defaultCenter] postNotificationName:NETWORK_MANAGER_NO_CONNECTION_NOTIFICATION_KEY object:nil];
NSString *errorMessage = NSLocalizedStringFromTableInBundle(@"It appears you don't have internet connection, please try again later...", nil, [TAPUtil currentBundle], @"");
NSString *errorMessage = NETWORK_MANAGER_NO_CONNECTION_MESSAGE;
NSError *error = [NSError errorWithDomain:errorMessage code:199 userInfo:@{@"message": errorMessage}];
failure (error);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment