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-05-09 17:26:37 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d2422ac0c5a95813dbe31d6d508a0accccccd1cf
d2422ac0
1 parent
ecdbd9b8
add verifyTicketAsync request
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/swiftApi.swift
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/swiftApi.swift
View file @
d2422ac
...
...
@@ -581,4 +581,62 @@ public class swiftApi {
public
func
getProfileAsync
(
_
getProfileCallback
:
@escaping
(
_
profileData
:
ProfileModel
?)
->
Void
)
->
Void
{
ProfileDataModel
()
.
getProfileData
(
getProfileCallback
)
}
public
class
VerifyTicketResponseModel
{
let
result
:
String
?
let
status
:
Int
?
init
(
dictionary
:
[
String
:
Any
])
{
self
.
result
=
dictionary
[
"result"
]
as?
String
?
??
""
self
.
status
=
dictionary
[
"status"
]
as?
Int
?
??
-
1
}
public
var
getResult
:
String
{
get
{
// getter
return
self
.
result
??
""
}
}
}
public
class
VerifyTicketModel
{
init
()
{
}
func
verifyTicket
(
guid
:
String
,
ticket
:
String
,
_
verifyTicketCallback
:
@escaping
(
_
verifyTicketData
:
VerifyTicketResponseModel
?)
->
Void
)
->
Void
{
let
instanceOfMyApi
=
MyApi
()
instanceOfMyApi
.
verifyTicketAsync
(
guid
,
ticket
,
verifyAsyncCallback
,
failureBlock
:
verifyAsyncFailureCallback
)
func
verifyAsyncCallback
(
_
verifyTicketData
:
[
AnyHashable
:
Any
]?)
->
Void
{
if
let
verifyTicketDataDictionary
=
verifyTicketData
as?
[
String
:
Any
]
{
let
tempResponse
=
VerifyTicketResponseModel
(
dictionary
:
verifyTicketDataDictionary
)
verifyTicketCallback
(
tempResponse
);
}
else
{
verifyTicketCallback
(
nil
)
}
}
func
verifyAsyncFailureCallback
(
_
error
:
Error
?)
->
Void
{
print
(
"verifyTicket error: "
)
print
(
error
)
print
(
"===================="
)
verifyTicketCallback
(
nil
)
}
}
}
public
func
verifyTicketAsync
(
guid
:
String
,
ticket
:
String
,
_
verifyTicketCallback
:
@escaping
(
_
verifyTicketData
:
VerifyTicketResponseModel
?)
->
Void
)
->
Void
{
VerifyTicketModel
()
.
verifyTicket
(
guid
:
guid
,
ticket
:
ticket
,
verifyTicketCallback
)
}
}
...
...
Please
register
or
login
to post a comment