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-13 13:47:22 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4dc50f44dc050ce4277d722ef96aa52fafff8877
4dc50f44
1 parent
d32b6084
fix return popup at handleSharing
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
1 deletions
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
4dc50f4
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
4dc50f4
...
...
@@ -3098,7 +3098,7 @@ public class swiftApi {
self
.
errorUsedDialog
(
controller
,
sharingData
?
.
_msg
??
""
)
}
else
if
(
sharingData
?
.
_status_outer
==
7
)
{
self
.
initialSharing
Dialog
(
controller
,
"Επιστροφή δώρου"
,
sharingData
?
.
_msg
??
""
,
sharingId
)
self
.
return
Dialog
(
controller
,
"Επιστροφή δώρου"
,
sharingData
?
.
_msg
??
""
,
sharingId
)
}
}
}
else
{
// status != 1
...
...
@@ -3173,6 +3173,72 @@ public class swiftApi {
}
}
func
returnDialog
(
_
controller
:
UIViewController
,
_
alertHeaderTitle
:
String
,
_
alertTitle
:
String
,
_
sharingId
:
String
)
->
Void
{
let
alert
=
UIAlertController
(
title
:
alertHeaderTitle
,
message
:
alertTitle
,
preferredStyle
:
.
alert
)
let
cancelButton
=
UIAlertAction
(
title
:
"Άκυρο"
,
style
:
.
default
,
handler
:
{
action
in
switch
action
.
style
{
case
.
default
:
print
(
"default"
)
case
.
cancel
:
print
(
"cancel"
)
case
.
destructive
:
print
(
"destructive"
)
}
})
// cancelButton.setValue(UIColor(rgb: 0xFC5757), forKey: "titleTextColor")
alert
.
addAction
(
cancelButton
)
alert
.
addAction
(
UIAlertAction
(
title
:
"Ενεργοποίηση"
,
style
:
.
default
,
handler
:
{
action
in
switch
action
.
style
{
case
.
default
:
self
.
cosmoteRetrieveSharingAsync
(
sharingId
:
sharingId
,
accept
:
true
,
retrieveSharingCallback
)
case
.
cancel
:
print
(
"cancel"
)
case
.
destructive
:
print
(
"destructive"
)
}
}))
controller
.
present
(
alert
,
animated
:
true
,
completion
:
nil
)
func
retrieveSharingCallback
(
_
sharingData
:
GenericResponseModel
?)
->
Void
{
if
(
sharingData
!=
nil
)
{
DispatchQueue
.
main
.
async
{
if
(
sharingData
?
.
getStatus
==
1
)
{
self
.
acceptSharingDialog
(
controller
)
swiftApi
()
.
getCouponsAsync
(
getCouponsCallback
)
func
getCouponsCallback
(
_
couponsData
:
Array
<
swiftApi
.
CouponItemModel
>
?)
->
Void
{
if
(
couponsData
!=
nil
)
{
DispatchQueue
.
main
.
async
{
SwiftEventBus
.
post
(
"coupons_fetched"
)
}
}
else
{
}
}
}
else
{
self
.
errorSharingDialog
(
controller
)
}
}
}
else
{
self
.
errorSharingDialog
(
controller
)
}
}
}
func
acceptSharingDialog
(
_
controller
:
UIViewController
)
->
Void
{
let
alert
=
UIAlertController
(
title
:
"Συγχαρητήρια!"
,
message
:
"Το δώρο σου ενεργοποιήθηκε επιτυχώς!"
,
preferredStyle
:
.
alert
)
...
...
Please
register
or
login
to post a comment