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-09-02 15:19:00 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
92c0e9e2bb00a8ed5c58f3393d5812aef2b0d06b
92c0e9e2
1 parent
85ae6e33
fix cosmoteSharingAsync callback
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
9 deletions
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
92c0e9e
...
...
@@ -2826,11 +2826,19 @@ public class swiftApi {
func
sharingCallback
(
_
sharingData
:
SharingResponseModel
?)
->
Void
{
if
(
sharingData
!=
nil
)
{
DispatchQueue
.
main
.
async
{
if
(
sharingData
?
.
_status
!=
nil
&&
sharingData
?
.
_status
!=
""
&&
sharingData
?
.
_status
==
"pending"
)
{
self
.
initialSharingDialog
(
controller
,
sharingData
?
.
_modal_text
??
""
,
sharingId
)
if
(
sharingData
?
.
_status_outer
==
1
)
{
if
(
sharingData
?
.
_status
!=
nil
&&
sharingData
?
.
_status
!=
""
&&
sharingData
?
.
_status
==
"pending"
)
{
self
.
initialSharingDialog
(
controller
,
sharingData
?
.
_modal_text
??
""
,
sharingId
)
}
else
if
(
sharingData
?
.
_status
!=
nil
&&
sharingData
?
.
_status
!=
""
&&
sharingData
?
.
_status
==
"reject"
)
{
self
.
returnSharingDialog
(
controller
,
sharingData
?
.
_modal_text
??
""
)
}
}
else
if
(
sharingData
?
.
_status
!=
nil
&&
sharingData
?
.
_status
!=
""
&&
sharingData
?
.
_status
==
"reject"
)
{
self
.
returnSharingDialog
(
controller
,
sharingData
?
.
_modal_text
??
""
)
}
else
if
(
sharingData
?
.
_status_outer
==
4
)
{
self
.
errorExpiredDialog
(
controller
)
}
else
if
(
sharingData
?
.
_status_outer
==
5
)
{
self
.
errorUsedDialog
(
controller
)
}
}
}
else
{
// status != 1
...
...
@@ -3013,6 +3021,44 @@ public class swiftApi {
controller
.
present
(
alert
,
animated
:
true
,
completion
:
nil
)
}
func
errorExpiredDialog
(
_
controller
:
UIViewController
)
->
Void
{
let
alert
=
UIAlertController
(
title
:
"Αποτυχία"
,
message
:
"Το δώρο έχει λήξει"
,
preferredStyle
:
.
alert
)
alert
.
addAction
(
UIAlertAction
(
title
:
"OK"
,
style
:
.
default
,
handler
:
{
action
in
switch
action
.
style
{
case
.
default
:
print
(
"default"
)
case
.
cancel
:
print
(
"cancel"
)
case
.
destructive
:
print
(
"destructive"
)
}
}))
controller
.
present
(
alert
,
animated
:
true
,
completion
:
nil
)
}
func
errorUsedDialog
(
_
controller
:
UIViewController
)
->
Void
{
let
alert
=
UIAlertController
(
title
:
"Αποτυχία"
,
message
:
"Το δώρο έχει ήδη χρησιμοποιηθεί"
,
preferredStyle
:
.
alert
)
alert
.
addAction
(
UIAlertAction
(
title
:
"OK"
,
style
:
.
default
,
handler
:
{
action
in
switch
action
.
style
{
case
.
default
:
print
(
"default"
)
case
.
cancel
:
print
(
"cancel"
)
case
.
destructive
:
print
(
"destructive"
)
}
}))
controller
.
present
(
alert
,
animated
:
true
,
completion
:
nil
)
}
public
class
LoyaltyGiftsForYouOfferClickEvent
{
private
var
title
:
String
...
...
@@ -3990,15 +4036,23 @@ public class swiftApi {
public
class
SharingResponseModel
{
private
var
modal_text
:
String
private
var
status
:
String
private
var
status_outer
:
Int
private
var
msg
:
String
init
()
{
self
.
modal_text
=
""
self
.
status
=
""
self
.
status_outer
=
-
1
self
.
msg
=
""
}
init
(
dictionary
:
[
String
:
Any
])
{
self
.
modal_text
=
dictionary
[
"modal_text"
]
as?
String
??
""
self
.
status
=
dictionary
[
"status"
]
as?
String
??
""
let
responseDataResult
=
(
dictionary
[
"result"
]
as?
[
String
:
Any
]
??
[
String
:
Any
]())
self
.
modal_text
=
responseDataResult
[
"modal_text"
]
as?
String
??
""
self
.
status
=
responseDataResult
[
"status"
]
as?
String
??
""
self
.
status_outer
=
dictionary
[
"status"
]
as?
Int
??
-
1
self
.
msg
=
dictionary
[
"msg"
]
as?
String
??
""
}
public
var
_modal_text
:
String
{
...
...
@@ -4018,6 +4072,24 @@ public class swiftApi {
self
.
status
=
newValue
}
}
public
var
_status_outer
:
Int
{
get
{
// getter
return
self
.
status_outer
}
set
(
newValue
)
{
//setter
self
.
status_outer
=
newValue
}
}
public
var
_msg
:
String
{
get
{
// getter
return
self
.
msg
}
set
(
newValue
)
{
//setter
self
.
msg
=
newValue
}
}
}
...
...
@@ -4029,10 +4101,10 @@ public class swiftApi {
func
requestCallback
(
_
responseData
:
[
AnyHashable
:
Any
]?)
->
Void
{
if
let
responseDataDictionary
=
responseData
as?
[
String
:
AnyObject
]
{
if
(
responseDataDictionary
[
"status"
]
as?
Int
==
1
)
{
let
responseDataResult
=
(
responseDataDictionary
[
"result"
]
as?
[
String
:
Any
]
??
[
String
:
Any
]())
if
(
(
responseDataDictionary
[
"status"
]
as?
Int
==
1
)
||
(
responseDataDictionary
[
"status"
]
as?
Int
==
4
)
||
(
responseDataDictionary
[
"status"
]
as?
Int
==
5
)
)
{
//
let responseDataResult = (responseDataDictionary["result"] as? [String: Any] ?? [String: Any]())
let
tempResponse
=
SharingResponseModel
(
dictionary
:
responseData
Result
)
let
tempResponse
=
SharingResponseModel
(
dictionary
:
responseData
Dictionary
)
cosmoteSharingCallback
(
tempResponse
);
}
else
{
cosmoteSharingCallback
(
nil
)
...
...
Please
register
or
login
to post a comment