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-07-04 16:17:54 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ec5ed0cbb422675d92bf335288e710149ff1c726
ec5ed0cb
1 parent
e5f79ff1
update handleSharing
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
30 deletions
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
ec5ed0c
...
...
@@ -1619,13 +1619,6 @@ public class swiftApi {
self
.
errorSharingDialog
(
controller
)
}
}
// initialSharingDialog(controller, alertTitle, "")
// acceptSharingDialog(controller)
// rejectSharingDialog(controller, "")
// returnSharingDialog(controller, alertTitle)
// errorSharingDialog(controller)
}
func
initialSharingDialog
(
_
controller
:
UIViewController
,
_
alertTitle
:
String
,
_
sharingId
:
String
)
->
Void
{
...
...
@@ -1634,32 +1627,43 @@ public class swiftApi {
alert
.
addAction
(
UIAlertAction
(
title
:
"Ενεργοποίηση"
,
style
:
.
default
,
handler
:
{
action
in
switch
action
.
style
{
case
.
default
:
// TODO: add cosmoteRetrieveSharing request
print
(
"default 1"
)
self
.
cosmoteRetrieveSharingAsync
(
sharingId
:
sharingId
,
accept
:
true
,
retrieveSharingCallback
)
case
.
cancel
:
print
(
"cancel 1"
)
case
.
destructive
:
print
(
"destructive 1"
)
}
}))
alert
.
addAction
(
UIAlertAction
(
title
:
"Απόρριψη"
,
style
:
.
default
,
handler
:
{
action
in
switch
action
.
style
{
case
.
default
:
self
.
rejectSharingDialog
(
controller
,
""
)
print
(
"default 2"
)
self
.
rejectSharingDialog
(
controller
,
sharingId
)
case
.
cancel
:
print
(
"cancel 2"
)
case
.
destructive
:
print
(
"destructive 2"
)
}
}))
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
)
}
else
{
self
.
errorSharingDialog
(
controller
)
}
}
}
else
{
self
.
errorSharingDialog
(
controller
)
}
}
}
func
acceptSharingDialog
(
_
controller
:
UIViewController
)
->
Void
{
...
...
@@ -1668,13 +1672,10 @@ public class swiftApi {
alert
.
addAction
(
UIAlertAction
(
title
:
"OK"
,
style
:
.
default
,
handler
:
{
action
in
switch
action
.
style
{
case
.
default
:
print
(
"default 1"
)
case
.
cancel
:
print
(
"cancel 1"
)
case
.
destructive
:
print
(
"destructive 1"
)
}
}))
...
...
@@ -1687,30 +1688,42 @@ public class swiftApi {
alert
.
addAction
(
UIAlertAction
(
title
:
"Απόρριψη"
,
style
:
.
default
,
handler
:
{
action
in
switch
action
.
style
{
case
.
default
:
print
(
"default 1"
)
self
.
cosmoteRetrieveSharingAsync
(
sharingId
:
sharingId
,
accept
:
false
,
retrieveSharingCallback
)
case
.
cancel
:
print
(
"cancel 1"
)
case
.
destructive
:
print
(
"destructive 1"
)
}
}))
alert
.
addAction
(
UIAlertAction
(
title
:
"Άκυρο"
,
style
:
.
default
,
handler
:
{
action
in
switch
action
.
style
{
case
.
default
:
print
(
"default 2"
)
case
.
cancel
:
print
(
"cancel 2"
)
case
.
destructive
:
print
(
"destructive 2"
)
}
}))
controller
.
present
(
alert
,
animated
:
true
,
completion
:
nil
)
func
retrieveSharingCallback
(
_
sharingData
:
GenericResponseModel
?)
->
Void
{
if
(
sharingData
!=
nil
)
{
DispatchQueue
.
main
.
async
{
if
(
sharingData
?
.
getStatus
==
1
)
{
self
.
returnSharingSuccessDialog
(
controller
)
}
else
{
self
.
errorSharingDialog
(
controller
)
}
}
}
else
{
self
.
errorSharingDialog
(
controller
)
}
}
}
func
returnSharingDialog
(
_
controller
:
UIViewController
,
_
alertTitle
:
String
)
->
Void
{
...
...
@@ -1719,13 +1732,10 @@ public class swiftApi {
alert
.
addAction
(
UIAlertAction
(
title
:
"OK"
,
style
:
.
default
,
handler
:
{
action
in
switch
action
.
style
{
case
.
default
:
print
(
"default 1"
)
case
.
cancel
:
print
(
"cancel 1"
)
case
.
destructive
:
print
(
"destructive 1"
)
}
}))
...
...
@@ -1738,13 +1748,26 @@ public class swiftApi {
alert
.
addAction
(
UIAlertAction
(
title
:
"OK"
,
style
:
.
default
,
handler
:
{
action
in
switch
action
.
style
{
case
.
default
:
print
(
"default 1"
)
case
.
cancel
:
print
(
"cancel 1"
)
case
.
destructive
:
print
(
"destructive 1"
)
}
}))
controller
.
present
(
alert
,
animated
:
true
,
completion
:
nil
)
}
func
returnSharingSuccessDialog
(
_
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
:
case
.
cancel
:
case
.
destructive
:
}
}))
...
...
Please
register
or
login
to post a comment