Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Vasilis
2022-02-04 10:48:26 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1b204c413ffffdddce3e3afd945c35f54296048f
1b204c41
1 parent
3825e841
addition of refreshtoken if failure in several calls
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
260 additions
and
2 deletions
WarplySDKFrameworkIOS/Warply/Warply.m
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcuserdata/billskouras.xcuserdatad/UserInterfaceState.xcuserstate
WarplySDKFrameworkIOS/Warply/Warply.m
View file @
1b204c4
...
...
@@ -682,7 +682,10 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
if
([
error
isEqual
:@{
@"code"
:
@401
}])
{
NSDictionary
*
dict
=
[
NSDictionary
alloc
];
dict
=
[
error
userInfo
];
NSString
*
errorCode
=
[
dict
objectForKey
:
@"NSLocalizedDescription"
];
if
([
errorCode
isEqual
:
@"Request failed: unauthorized (401)"
])
{
[
self
refreshToken
:
^
(
NSDictionary
*
response
)
{
// [_db executeUpdate:@"UPDATE requestVariables SET access_token = ?, refresh_token = ? WHERE id = 1", [response objectForKey:@"access_token"], [response objectForKey:@"refresh_token"]];
NSDictionary
*
successResponse
=
@{
@"result"
:
@"success"
,
@"status"
:
@1
};
...
...
@@ -726,7 +729,10 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
if
([
error
isEqual
:@{
@"code"
:
@401
}])
{
NSDictionary
*
dict
=
[
NSDictionary
alloc
];
dict
=
[
error
userInfo
];
NSString
*
errorCode
=
[
dict
objectForKey
:
@"NSLocalizedDescription"
];
if
([
errorCode
isEqual
:
@"Request failed: unauthorized (401)"
])
{
[
self
refreshToken
:
^
(
NSDictionary
*
response
)
{
[
self
sendContext8
:
jsonData
successBlock
:
^
(
NSDictionary
*
contextResponse
)
{
if
(
success
)
{
...
...
@@ -824,9 +830,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
NSDictionary
*
dict
=
[
NSDictionary
alloc
];
dict
=
[
error
userInfo
];
NSString
*
errorCode
=
[
dict
objectForKey
:
@"NSLocalizedDescription"
];
if
([
errorCode
isEqual
:
@"Request failed: unauthorized (401)"
])
{
[
self
refreshToken
:
^
(
NSDictionary
*
response
)
{
[
self
sendContext8
:
jsonData
successBlock
:
^
(
NSDictionary
*
contextResponse
)
{
if
(
success
)
{
success
(
contextResponse
);
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
failure
(
error
);
}
}];
}
failureBlock
:
^
(
NSError
*
error
)
{
if
(
failure
)
{
[
_db
executeUpdate
:
@"DROP TABLE requestVariables"
];
failure
(
error
);
}
NSLog
(
@"Error at token %@"
,
error
);
}];
}
NSLog
(
@"Error at edit profile %@"
,
error
);
}
}];
}
...
...
@@ -840,9 +867,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
NSDictionary
*
dict
=
[
NSDictionary
alloc
];
dict
=
[
error
userInfo
];
NSString
*
errorCode
=
[
dict
objectForKey
:
@"NSLocalizedDescription"
];
if
([
errorCode
isEqual
:
@"Request failed: unauthorized (401)"
])
{
[
self
refreshToken
:
^
(
NSDictionary
*
response
)
{
[
self
sendContext8
:
jsonData
successBlock
:
^
(
NSDictionary
*
contextResponse
)
{
if
(
success
)
{
success
(
contextResponse
);
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
failure
(
error
);
}
}];
}
failureBlock
:
^
(
NSError
*
error
)
{
if
(
failure
)
{
[
_db
executeUpdate
:
@"DROP TABLE requestVariables"
];
failure
(
error
);
}
NSLog
(
@"Error at token %@"
,
error
);
}];
}
NSLog
(
@"Error at change profile image %@"
,
error
);
}
}];
}
...
...
@@ -856,9 +904,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
NSDictionary
*
dict
=
[
NSDictionary
alloc
];
dict
=
[
error
userInfo
];
NSString
*
errorCode
=
[
dict
objectForKey
:
@"NSLocalizedDescription"
];
if
([
errorCode
isEqual
:
@"Request failed: unauthorized (401)"
])
{
[
self
refreshToken
:
^
(
NSDictionary
*
response
)
{
[
self
sendContext8
:
jsonData
successBlock
:
^
(
NSDictionary
*
contextResponse
)
{
if
(
success
)
{
success
(
contextResponse
);
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
failure
(
error
);
}
}];
}
failureBlock
:
^
(
NSError
*
error
)
{
if
(
failure
)
{
[
_db
executeUpdate
:
@"DROP TABLE requestVariables"
];
failure
(
error
);
}
NSLog
(
@"Error at token %@"
,
error
);
}];
}
NSLog
(
@"Error at add card %@"
,
error
);
}
}];
}
...
...
@@ -872,9 +941,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
NSDictionary
*
dict
=
[
NSDictionary
alloc
];
dict
=
[
error
userInfo
];
NSString
*
errorCode
=
[
dict
objectForKey
:
@"NSLocalizedDescription"
];
if
([
errorCode
isEqual
:
@"Request failed: unauthorized (401)"
])
{
[
self
refreshToken
:
^
(
NSDictionary
*
response
)
{
[
self
sendContext8
:
jsonData
successBlock
:
^
(
NSDictionary
*
contextResponse
)
{
if
(
success
)
{
success
(
contextResponse
);
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
failure
(
error
);
}
}];
}
failureBlock
:
^
(
NSError
*
error
)
{
if
(
failure
)
{
[
_db
executeUpdate
:
@"DROP TABLE requestVariables"
];
failure
(
error
);
}
NSLog
(
@"Error at token %@"
,
error
);
}];
}
NSLog
(
@"Error at get cards %@"
,
error
);
}
}];
}
...
...
@@ -888,9 +978,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
NSDictionary
*
dict
=
[
NSDictionary
alloc
];
dict
=
[
error
userInfo
];
NSString
*
errorCode
=
[
dict
objectForKey
:
@"NSLocalizedDescription"
];
if
([
errorCode
isEqual
:
@"Request failed: unauthorized (401)"
])
{
[
self
refreshToken
:
^
(
NSDictionary
*
response
)
{
[
self
sendContext8
:
jsonData
successBlock
:
^
(
NSDictionary
*
contextResponse
)
{
if
(
success
)
{
success
(
contextResponse
);
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
failure
(
error
);
}
}];
}
failureBlock
:
^
(
NSError
*
error
)
{
if
(
failure
)
{
[
_db
executeUpdate
:
@"DROP TABLE requestVariables"
];
failure
(
error
);
}
NSLog
(
@"Error at token %@"
,
error
);
}];
}
NSLog
(
@"Error at get cards %@"
,
error
);
}
}];
}
...
...
@@ -939,9 +1050,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
NSDictionary
*
dict
=
[
NSDictionary
alloc
];
dict
=
[
error
userInfo
];
NSString
*
errorCode
=
[
dict
objectForKey
:
@"NSLocalizedDescription"
];
if
([
errorCode
isEqual
:
@"Request failed: unauthorized (401)"
])
{
[
self
refreshToken
:
^
(
NSDictionary
*
response
)
{
[
self
sendContext8
:
jsonData
successBlock
:
^
(
NSDictionary
*
contextResponse
)
{
if
(
success
)
{
success
(
contextResponse
);
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
failure
(
error
);
}
}];
}
failureBlock
:
^
(
NSError
*
error
)
{
if
(
failure
)
{
[
_db
executeUpdate
:
@"DROP TABLE requestVariables"
];
failure
(
error
);
}
NSLog
(
@"Error at token %@"
,
error
);
}];
}
NSLog
(
@"Error at get cards %@"
,
error
);
}
}];
}
...
...
@@ -955,9 +1087,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
NSDictionary
*
dict
=
[
NSDictionary
alloc
];
dict
=
[
error
userInfo
];
NSString
*
errorCode
=
[
dict
objectForKey
:
@"NSLocalizedDescription"
];
if
([
errorCode
isEqual
:
@"Request failed: unauthorized (401)"
])
{
[
self
refreshToken
:
^
(
NSDictionary
*
response
)
{
[
self
sendContext8
:
jsonData
successBlock
:
^
(
NSDictionary
*
contextResponse
)
{
if
(
success
)
{
success
(
contextResponse
);
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
failure
(
error
);
}
}];
}
failureBlock
:
^
(
NSError
*
error
)
{
if
(
failure
)
{
[
_db
executeUpdate
:
@"DROP TABLE requestVariables"
];
failure
(
error
);
}
NSLog
(
@"Error at token %@"
,
error
);
}];
}
NSLog
(
@"Error at get cards %@"
,
error
);
}
}];
}
...
...
@@ -971,9 +1124,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
NSDictionary
*
dict
=
[
NSDictionary
alloc
];
dict
=
[
error
userInfo
];
NSString
*
errorCode
=
[
dict
objectForKey
:
@"NSLocalizedDescription"
];
if
([
errorCode
isEqual
:
@"Request failed: unauthorized (401)"
])
{
[
self
refreshToken
:
^
(
NSDictionary
*
response
)
{
[
self
sendContext8
:
jsonData
successBlock
:
^
(
NSDictionary
*
contextResponse
)
{
if
(
success
)
{
success
(
contextResponse
);
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
failure
(
error
);
}
}];
}
failureBlock
:
^
(
NSError
*
error
)
{
if
(
failure
)
{
[
_db
executeUpdate
:
@"DROP TABLE requestVariables"
];
failure
(
error
);
}
NSLog
(
@"Error at token %@"
,
error
);
}];
}
NSLog
(
@"Error at get cards %@"
,
error
);
}
}];
}
...
...
@@ -987,9 +1161,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
NSDictionary
*
dict
=
[
NSDictionary
alloc
];
dict
=
[
error
userInfo
];
NSString
*
errorCode
=
[
dict
objectForKey
:
@"NSLocalizedDescription"
];
if
([
errorCode
isEqual
:
@"Request failed: unauthorized (401)"
])
{
[
self
refreshToken
:
^
(
NSDictionary
*
response
)
{
[
self
sendContext8
:
jsonData
successBlock
:
^
(
NSDictionary
*
contextResponse
)
{
if
(
success
)
{
success
(
contextResponse
);
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
failure
(
error
);
}
}];
}
failureBlock
:
^
(
NSError
*
error
)
{
if
(
failure
)
{
[
_db
executeUpdate
:
@"DROP TABLE requestVariables"
];
failure
(
error
);
}
NSLog
(
@"Error at token %@"
,
error
);
}];
}
NSLog
(
@"Error at get cards %@"
,
error
);
}
}];
}
...
...
@@ -1003,9 +1198,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
NSDictionary
*
dict
=
[
NSDictionary
alloc
];
dict
=
[
error
userInfo
];
NSString
*
errorCode
=
[
dict
objectForKey
:
@"NSLocalizedDescription"
];
if
([
errorCode
isEqual
:
@"Request failed: unauthorized (401)"
])
{
[
self
refreshToken
:
^
(
NSDictionary
*
response
)
{
[
self
sendContext8
:
jsonData
successBlock
:
^
(
NSDictionary
*
contextResponse
)
{
if
(
success
)
{
success
(
contextResponse
);
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
failure
(
error
);
}
}];
}
failureBlock
:
^
(
NSError
*
error
)
{
if
(
failure
)
{
[
_db
executeUpdate
:
@"DROP TABLE requestVariables"
];
failure
(
error
);
}
NSLog
(
@"Error at token %@"
,
error
);
}];
}
NSLog
(
@"Error at get cards %@"
,
error
);
}
}];
}
...
...
@@ -1064,9 +1280,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
NSDictionary
*
dict
=
[
NSDictionary
alloc
];
dict
=
[
error
userInfo
];
NSString
*
errorCode
=
[
dict
objectForKey
:
@"NSLocalizedDescription"
];
if
([
errorCode
isEqual
:
@"Request failed: unauthorized (401)"
])
{
[
self
refreshToken
:
^
(
NSDictionary
*
response
)
{
[
self
sendContext8
:
jsonData
successBlock
:
^
(
NSDictionary
*
contextResponse
)
{
if
(
success
)
{
success
(
contextResponse
);
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
failure
(
error
);
}
}];
}
failureBlock
:
^
(
NSError
*
error
)
{
if
(
failure
)
{
[
_db
executeUpdate
:
@"DROP TABLE requestVariables"
];
failure
(
error
);
}
NSLog
(
@"Error at token %@"
,
error
);
}];
}
NSLog
(
@"Error at edit profile %@"
,
error
);
}
}];
}
...
...
@@ -1096,9 +1333,30 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
NSDictionary
*
dict
=
[
NSDictionary
alloc
];
dict
=
[
error
userInfo
];
NSString
*
errorCode
=
[
dict
objectForKey
:
@"NSLocalizedDescription"
];
if
([
errorCode
isEqual
:
@"Request failed: unauthorized (401)"
])
{
[
self
refreshToken
:
^
(
NSDictionary
*
response
)
{
[
self
sendContext8
:
jsonData
successBlock
:
^
(
NSDictionary
*
contextResponse
)
{
if
(
success
)
{
success
(
contextResponse
);
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
failure
(
error
);
}
}];
}
failureBlock
:
^
(
NSError
*
error
)
{
if
(
failure
)
{
[
_db
executeUpdate
:
@"DROP TABLE requestVariables"
];
failure
(
error
);
}
NSLog
(
@"Error at token %@"
,
error
);
}];
}
NSLog
(
@"Error at get cards %@"
,
error
);
}
}];
}
...
...
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcuserdata/billskouras.xcuserdatad/UserInterfaceState.xcuserstate
View file @
1b204c4
No preview for this file type
Please
register
or
login
to post a comment