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-21 15:22:03 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
129ae64adaccaee8cd621c86513861c1d2a1ae7d
129ae64a
1 parent
5a456b27
update redeemCouponSetAsync request
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
24 additions
and
13 deletions
SwiftWarplyFramework/SwiftWarplyFramework/CouponViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/GiftsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/MFYViewController.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/CouponViewController.swift
View file @
129ae64
...
...
@@ -27,6 +27,7 @@ import UIKit
var
termsVisible
:
Bool
=
false
;
public
var
couponset
:
swiftApi
.
CouponSetItemModel
?
public
var
campaign
:
swiftApi
.
CampaignItemModel
?
public
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
...
...
@@ -93,8 +94,8 @@ import UIKit
}
}
func
redeemCouponSetRequest
(
uuid
:
String
)
{
swiftApi
()
.
redeemCouponSetAsync
(
uuid
:
uuid
,
redeemCouponSetCallback
)
func
redeemCouponSetRequest
(
uuid
:
String
,
communication_uuid
:
String
)
{
swiftApi
()
.
redeemCouponSetAsync
(
uuid
:
uuid
,
communication_uuid
:
communication_uuid
,
redeemCouponSetCallback
)
}
func
redeemCouponSetCallback
(
_
response
:
swiftApi
.
GenericResponseModel
?)
->
Void
{
...
...
@@ -104,15 +105,22 @@ import UIKit
self
.
showSuccessDialog
(
"Το κουπόνι σου ενεργοποιήθηκε"
,
"Μπορείς να το βρεις στην αρχική οθόνη της εφαρμογής και στην ενότητα ενεργά δώρα!"
)
swiftApi
()
.
getCouponsAsync
(
getCouponsCallback
)
swiftApi
()
.
getCampaignsAsyncNew
(
language
:
"en"
,
filters
:
[
String
:
Any
](),
getCampaignsCallback
)
func
getCouponsCallback
(
_
couponsData
:
Array
<
swiftApi
.
CouponItemModel
>
?)
->
Void
{
if
(
couponsData
!=
nil
)
{
DispatchQueue
.
main
.
async
{
print
(
"========= getCouponsRequest SUCCESSSS CouponViewController ========="
)
}
}
else
{
print
(
"========= getCouponsRequest ERROR CouponViewController ========="
)
}
}
func
getCampaignsCallback
(
_
campaignsData
:
Array
<
swiftApi
.
CampaignItemModel
>
?)
->
Void
{
if
(
campaignsData
!=
nil
)
{
DispatchQueue
.
main
.
async
{
}
}
else
{
}
}
}
else
if
(
response
?
.
getStatus
==
3
)
{
...
...
@@ -171,7 +179,7 @@ import UIKit
@IBAction
func
redeemButtomAction
(
_
sender
:
Any
)
{
// SwiftEventBus.post("couponRedeem", sender: coupon)
redeemCouponSetRequest
(
uuid
:
couponset
?
.
uuid
??
""
)
redeemCouponSetRequest
(
uuid
:
couponset
?
.
uuid
??
""
,
communication_uuid
:
campaign
?
.
session_uuid
??
""
)
// let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
// let vc = storyboard.instantiateViewController(withIdentifier: "MakeItAPresentViewController") as! SwiftWarplyFramework.MakeItAPresentViewController
...
...
SwiftWarplyFramework/SwiftWarplyFramework/GiftsViewController.swift
View file @
129ae64
...
...
@@ -112,6 +112,7 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"CouponViewController"
)
as!
SwiftWarplyFramework
.
CouponViewController
vc
.
couponset
=
item
vc
.
campaign
=
campaigns
[
indexPath
.
row
]
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
break
;
...
...
SwiftWarplyFramework/SwiftWarplyFramework/MFYViewController.swift
View file @
129ae64
...
...
@@ -100,6 +100,7 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"CouponViewController"
)
as!
SwiftWarplyFramework
.
CouponViewController
vc
.
couponset
=
item
vc
.
campaign
=
campaigns
[
indexPath
.
row
]
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
break
;
...
...
SwiftWarplyFramework/SwiftWarplyFramework/MyApi.h
View file @
129ae64
...
...
@@ -82,7 +82,7 @@
-
(
void
)
verifyTicketAsync
:(
NSString
*
)
guid
:
(
NSString
*
)
ticket
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
getProfileAsync
:(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
consumerIntegrationAsync
:(
NSNumber
*
)
nonTelco
:
(
NSNumber
*
)
acceptedConsent
:
(
NSArray
*
)
msisdnList
:
(
NSString
*
)
guid
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
redeemCouponSetAsync
:(
NSString
*
)
uuid
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
redeemCouponSetAsync
:(
NSString
*
)
uuid
:
(
NSString
*
)
communication_uuid
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
getPacingDetailsAsync
:(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
cosmoteSharingAsync
:(
NSString
*
)
sharingId
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
cosmoteRetrieveSharingAsync
:(
NSString
*
)
sharingId
:
(
NSNumber
*
)
accept
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
;
...
...
SwiftWarplyFramework/SwiftWarplyFramework/MyApi.m
View file @
129ae64
...
...
@@ -1368,9 +1368,9 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify";
}];
}
-
(
void
)
redeemCouponSetAsync
:
(
NSString
*
)
uuid
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
-
(
void
)
redeemCouponSetAsync
:
(
NSString
*
)
uuid
:
(
NSString
*
)
communication_uuid
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
{
[[
Warply
sharedService
]
redeemCouponSetsWithSuccessBlock
:
uuid
:
^
(
NSDictionary
*
response
)
{
[[
Warply
sharedService
]
redeemCouponSetsWithSuccessBlock
:
uuid
:
communication_uuid
:
^
(
NSDictionary
*
response
)
{
if
(
success
)
{
success
(
response
);
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.h
View file @
129ae64
...
...
@@ -383,7 +383,7 @@ WL_VERSION_INTERFACE()
-
(
void
)
getCouponSetsWithSuccessBlock
:(
NSNumber
*
)
active
andVisible
:
(
NSNumber
*
)
visible
andUuids
:
(
NSArray
*
)
uuids
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
redeemCouponSetsWithSuccessBlock
:(
NSString
*
)
uuid
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
redeemCouponSetsWithSuccessBlock
:(
NSString
*
)
uuid
:
(
NSString
*
)
communication_uuid
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
cosmoteCouponSharingWithSuccessBlock
:(
NSString
*
)
coupon
:
(
NSString
*
)
sender
:
(
NSString
*
)
receiver
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
;
...
...
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
View file @
129ae64
...
...
@@ -2041,9 +2041,9 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}];
}
-
(
void
)
redeemCouponSetsWithSuccessBlock
:
(
NSString
*
)
uuid
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
-
(
void
)
redeemCouponSetsWithSuccessBlock
:
(
NSString
*
)
uuid
:
(
NSString
*
)
communication_uuid
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
{
NSDictionary
*
postDictionary
=
@{
@"coupon"
:
@{
@"action"
:
@"retrieve_coupon"
,
@"coupon_set"
:
uuid
}};
NSDictionary
*
postDictionary
=
@{
@"coupon"
:
@{
@"action"
:
@"retrieve_coupon"
,
@"coupon_set"
:
uuid
,
@"communication_uuid"
:
communication_uuid
}};
NSData
*
jsonData
=
[
NSJSONSerialization
dataWithJSONObject
:
postDictionary
options
:
0
error
:
NULL
];
[
self
sendContext8
:
jsonData
successBlock
:
^
(
NSDictionary
*
contextResponse
)
{
if
(
success
)
{
...
...
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
129ae64
...
...
@@ -2440,6 +2440,7 @@ public class swiftApi {
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"CouponViewController"
)
as!
SwiftWarplyFramework
.
CouponViewController
vc
.
couponset
=
item
vc
.
campaign
=
campaign
controller
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
break
;
...
...
@@ -2589,10 +2590,10 @@ public class swiftApi {
}
}
public
func
redeemCouponSetAsync
(
uuid
:
String
,
_
redeemCouponSetCallback
:
@escaping
(
_
responseData
:
GenericResponseModel
?)
->
Void
)
->
Void
{
public
func
redeemCouponSetAsync
(
uuid
:
String
,
communication_uuid
:
String
,
_
redeemCouponSetCallback
:
@escaping
(
_
responseData
:
GenericResponseModel
?)
->
Void
)
->
Void
{
let
instanceOfMyApi
=
MyApi
()
instanceOfMyApi
.
redeemCouponSetAsync
(
uuid
,
requestCallback
,
failureBlock
:
requestFailureCallback
)
instanceOfMyApi
.
redeemCouponSetAsync
(
uuid
,
communication_uuid
,
requestCallback
,
failureBlock
:
requestFailureCallback
)
func
requestCallback
(
_
responseData
:
[
AnyHashable
:
Any
]?)
->
Void
{
...
...
Please
register
or
login
to post a comment