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-10-18 16:54:03 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
87860ea58874bbe4242fc6ad4d14ebbc8db20937
87860ea5
1 parent
d28ee9a6
added updateRefreshToken
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
0 deletions
SwiftWarplyFramework/SwiftWarplyFramework/CampaignViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/MyApi.h
SwiftWarplyFramework/SwiftWarplyFramework/MyApi.m
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.h
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/CampaignViewController.swift
View file @
87860ea
...
...
@@ -348,6 +348,25 @@ var timer2: DispatchSourceTimer?
firebaseEvent
.
setParameter
=
(
"name"
,
name
)
firebaseEvent
.
setParameter
=
(
"seconds"
,
seconds
)
SwiftEventBus
.
post
(
"firebase"
,
sender
:
firebaseEvent
)
}
else
if
(
eventArray
[
1
]
==
"refreshToken"
)
{
var
access_token
:
String
=
""
if
(
eventArray
.
count
>
2
)
{
access_token
=
String
(
eventArray
[
2
])
}
else
{
access_token
=
""
}
var
refresh_token
:
String
=
""
if
(
eventArray
.
count
>
3
)
{
refresh_token
=
String
(
eventArray
[
3
])
}
else
{
refresh_token
=
""
}
if
(
access_token
!=
""
&&
refresh_token
!=
""
)
{
swiftApi
()
.
updateRefreshToken
(
access_token
:
access_token
,
refresh_token
:
refresh_token
)
}
}
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/MyApi.h
View file @
87860ea
...
...
@@ -108,6 +108,7 @@
-
(
void
)
editProfileAsync
:(
NSString
*
)
firstname
andLastname
:(
NSString
*
)
lastname
andEmail
:(
NSString
*
)
email
andSalutation
:(
NSString
*
)
salutation
andMsisdn
:(
NSString
*
)
msisdn
andNickname
:(
NSString
*
)
nickname
andGender
:(
NSString
*
)
gender
andBirthday
:(
NSString
*
)
birthday
andNameDay
:(
NSString
*
)
nameday
andTaxID
:(
NSString
*
)
taxid
andProfileMetadata
:(
NSDictionary
*
)
profileMetadata
optin
:(
NSNumber
*
)
optin
newsLetter
:(
NSNumber
*
)
newsletter
andSMS
:(
NSNumber
*
)
sms
andSegmentation
:(
NSNumber
*
)
segmentation
andSMSSegmentation
:(
NSNumber
*
)
smsSegmentation
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
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
;
@end
#endif
/* MyApi_h */
...
...
SwiftWarplyFramework/SwiftWarplyFramework/MyApi.m
View file @
87860ea
...
...
@@ -1673,4 +1673,9 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify";
[[
Warply
sharedService
]
addEvent
:
simpleEvent
priority
:
priority
];
}
-
(
void
)
updateRefreshTokenMA
:
(
NSString
*
)
access_token
:
(
NSString
*
)
refresh_token
{
[[
Warply
sharedService
]
updateRefreshTokenW
:
access_token
:
refresh_token
}
@end
...
...
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.h
View file @
87860ea
...
...
@@ -327,6 +327,8 @@ WL_VERSION_INTERFACE()
-
(
void
)
registerWithSuccessBlock
:(
NSString
*
)
id
andPassword
:(
NSString
*
)
password
andName
:(
NSString
*
)
name
andEmail
:(
NSString
*
)
email
andSegmentation
:(
NSNumber
*
)
segmentation
andNewsletter
:(
NSNumber
*
)
newsletter
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
updateRefreshTokenW
:(
NSString
*
)
access_token
:
(
NSString
*
)
refresh_token
;
-
(
void
)
refreshToken
:(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
refreshToken2ndTry
:(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:(
void
(
^
)(
NSError
*
error
))
failure
;
...
...
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
View file @
87860ea
...
...
@@ -903,6 +903,13 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}];
}
-
(
void
)
updateRefreshTokenW
:
(
NSString
*
)
access_token
:
(
NSString
*
)
refresh_token
{
if
([
_db
tableExists
:
@"requestVariables"
]
==
YES
)
{
[
_db
executeUpdate
:
@"UPDATE requestVariables SET access_token = ?, refresh_token = ? WHERE id = 1"
,
access_token
,
refresh_token
];
}
}
-
(
void
)
refreshToken
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
{
FMResultSet
*
refreshTokenSet
=
[
_db
executeQuery
:
@"SELECT refresh_token FROM requestVariables WHERE id = 1;"
];
...
...
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
87860ea
...
...
@@ -5959,5 +5959,11 @@ public class swiftApi {
}
}
public
func
updateRefreshToken
(
access_token
:
String
,
refresh_token
:
String
)
->
Void
{
let
instanceOfMyApi
=
MyApi
()
instanceOfMyApi
.
updateRefreshTokenMA
(
access_token
,
refresh_token
)
}
}
...
...
Please
register
or
login
to post a comment