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
Manos Chorianopoulos
2022-11-22 12:35:37 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2233fa7a05b7c09787d5794b1d74ed5a119de969
2233fa7a
1 parent
1dcc1c11
fix db select errors
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
12 deletions
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
View file @
2233fa7
...
...
@@ -709,6 +709,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}
@catch
(
NSException
*
exception
)
{
NSLog
(
@"SELECT accessToken error: %@"
,
exception
.
reason
);
accessToken
=
@""
;
}
@finally
{
// NSLog(@"Finally condition");
...
...
@@ -724,36 +725,81 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
};
-
(
NSString
*
)
getRefreshToken
{
NSString
*
refreshToken
=
[
NSString
alloc
];
// NSString *refreshToken = [NSString alloc];
NSString
*
refreshToken
=
@""
;
if
([
_db
tableExists
:
@"requestVariables"
]
==
YES
)
{
FMResultSet
*
refreshTokenSet
=
[
_db
executeQuery
:
@"SELECT refresh_token FROM requestVariables WHERE id = 1;"
];
while
([
refreshTokenSet
next
])
{
refreshToken
=
[[
refreshTokenSet
resultDictionary
][
@"refresh_token"
]
stringValue
];
@try
{
FMResultSet
*
refreshTokenSet
=
[
_db
executeQuery
:
@"SELECT refresh_token FROM requestVariables WHERE id = 1;"
];
while
([
refreshTokenSet
next
])
{
refreshToken
=
[[
refreshTokenSet
resultDictionary
][
@"refresh_token"
]
stringValue
];
}
}
@catch
(
NSException
*
exception
)
{
NSLog
(
@"SELECT refreshToken error: %@"
,
exception
.
reason
);
refreshToken
=
@""
;
}
@finally
{
// NSLog(@"Finally condition");
}
// FMResultSet *refreshTokenSet = [_db executeQuery:@"SELECT refresh_token FROM requestVariables WHERE id = 1;"];
// while ([refreshTokenSet next]) {
// refreshToken = [[refreshTokenSet resultDictionary][@"refresh_token"] stringValue];
// }
return
refreshToken
;
}
return
@""
;
}
-
(
NSString
*
)
getClientId
{
NSString
*
clientId
=
[
NSString
alloc
];
// NSString *clientId = [NSString alloc];
NSString
*
clientId
=
@""
;
if
([
_db
tableExists
:
@"requestVariables"
]
==
YES
)
{
FMResultSet
*
clientIdSet
=
[
_db
executeQuery
:
@"SELECT client_id FROM requestVariables WHERE id = 1;"
];
while
([
clientIdSet
next
])
{
clientId
=
[[
clientIdSet
resultDictionary
][
@"client_id"
]
stringValue
];
@try
{
FMResultSet
*
clientIdSet
=
[
_db
executeQuery
:
@"SELECT client_id FROM requestVariables WHERE id = 1;"
];
while
([
clientIdSet
next
])
{
clientId
=
[[
clientIdSet
resultDictionary
][
@"client_id"
]
stringValue
];
}
}
@catch
(
NSException
*
exception
)
{
NSLog
(
@"SELECT clientId error: %@"
,
exception
.
reason
);
clientId
=
@""
;
}
@finally
{
// NSLog(@"Finally condition");
}
// FMResultSet *clientIdSet = [_db executeQuery:@"SELECT client_id FROM requestVariables WHERE id = 1;"];
// while ([clientIdSet next]) {
// clientId = [[clientIdSet resultDictionary][@"client_id"] stringValue];
// }
return
clientId
;
}
return
@""
;
}
-
(
NSString
*
)
getClientSecret
{
NSString
*
clientSecret
=
[
NSString
alloc
];
// NSString *clientSecret = [NSString alloc];
NSString
*
clientSecret
=
@""
;
if
([
_db
tableExists
:
@"requestVariables"
]
==
YES
)
{
FMResultSet
*
clientSecretSet
=
[
_db
executeQuery
:
@"SELECT client_secret FROM requestVariables WHERE id = 1;"
];
while
([
clientSecretSet
next
])
{
clientSecret
=
[[
clientSecretSet
resultDictionary
][
@"client_secret"
]
stringValue
];
@try
{
FMResultSet
*
clientSecretSet
=
[
_db
executeQuery
:
@"SELECT client_secret FROM requestVariables WHERE id = 1;"
];
while
([
clientSecretSet
next
])
{
clientSecret
=
[[
clientSecretSet
resultDictionary
][
@"client_secret"
]
stringValue
];
}
}
@catch
(
NSException
*
exception
)
{
NSLog
(
@"SELECT clientSecret error: %@"
,
exception
.
reason
);
clientSecret
=
@""
;
}
@finally
{
// NSLog(@"Finally condition");
}
// FMResultSet *clientSecretSet = [_db executeQuery:@"SELECT client_secret FROM requestVariables WHERE id = 1;"];
// while ([clientSecretSet next]) {
// clientSecret = [[clientSecretSet resultDictionary][@"client_secret"] stringValue];
// }
return
clientSecret
;
}
return
@""
;
...
...
Please
register
or
login
to post a comment