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
2024-09-02 14:07:06 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ec5edd9a0a3dbd24b8de316a1a3d18e2c7475df5
ec5edd9a
1 parent
18652c8e
dinning campaign fix
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
2 deletions
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/GiftsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/MFYViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
ec5edd9
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/GiftsViewController.swift
View file @
ec5edd9
...
...
@@ -329,6 +329,70 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
break
;
}
}
}
else
if
(
campaigns
[
indexPath
.
row
]
.
session_uuid
!=
nil
&&
campaigns
[
indexPath
.
row
]
.
session_uuid
!=
""
)
{
let
status
=
swiftApi
()
.
getNetworkStatus
()
if
(
status
==
-
1
||
status
==
0
)
{
self
.
showDialog
(
"Δεν υπάρχει σύνδεση"
,
"Αυτή τη στιγμή βρίσκεσαι εκτός σύνδεσης. Παρακαλούμε βεβαιώσου ότι είσαι συνδεδεμένος στο διαδίκτυο και προσπάθησε ξανά."
)
}
else
{
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"CampaignViewController"
)
as!
SwiftWarplyFramework
.
CampaignViewController
var
url
=
""
var
params
=
""
let
isCcmsOffer
=
(
campaigns
[
indexPath
.
row
]
.
ccms_offer
!=
nil
)
&&
(
campaigns
[
indexPath
.
row
]
.
ccms_offer
!=
""
)
&&
(
campaigns
[
indexPath
.
row
]
.
ccms_offer
==
"true"
)
if
(
isCcmsOffer
)
{
let
ccmsCampaigns
=
swiftApi
()
.
getCCMSLoyaltyCampaigns
()
let
loyaltyCampaignIdExists
=
ccmsCampaigns
.
contains
{
$0
.
_loyaltyCampaignId
==
campaigns
[
indexPath
.
row
]
.
session_uuid
}
if
(
loyaltyCampaignIdExists
==
true
)
{
var
ccmsCampaignFound
:
swiftApi
.
LoyaltyContextualOfferModel
=
swiftApi
.
LoyaltyContextualOfferModel
()
for
item
in
ccmsCampaigns
{
if
(
item
.
_loyaltyCampaignId
==
campaigns
[
indexPath
.
row
]
.
session_uuid
)
{
ccmsCampaignFound
=
item
}
}
swiftApi
()
.
logTrackersEvent
(
"click"
,
(
"Contextual:"
+
(
ccmsCampaignFound
.
_sessionId
)))
url
=
swiftApi
()
.
constructCcmsUrl
(
campaigns
[
indexPath
.
row
],
ccmsCampaignFound
)
params
=
swiftApi
()
.
constructCcmsParams
(
campaigns
[
indexPath
.
row
],
ccmsCampaignFound
)
}
else
{
url
=
swiftApi
()
.
constructCampaignUrl
(
campaigns
[
indexPath
.
row
])
params
=
swiftApi
()
.
constructCampaignParams
(
campaigns
[
indexPath
.
row
])
}
let
encoder
=
JSONEncoder
()
encoder
.
outputFormatting
=
.
prettyPrinted
let
data
=
try!
encoder
.
encode
(
campaigns
[
indexPath
.
row
])
print
(
"CCMS_CLICK "
+
String
(
data
:
data
,
encoding
:
.
utf8
)
!
)
}
else
{
swiftApi
()
.
logTrackersEvent
(
"click"
,
(
"Loyalty:"
+
(
campaigns
[
indexPath
.
row
]
.
session_uuid
??
""
)))
url
=
swiftApi
()
.
constructCampaignUrl
(
campaigns
[
indexPath
.
row
])
params
=
swiftApi
()
.
constructCampaignParams
(
campaigns
[
indexPath
.
row
])
let
encoder
=
JSONEncoder
()
encoder
.
outputFormatting
=
.
prettyPrinted
let
data
=
try!
encoder
.
encode
(
campaigns
[
indexPath
.
row
])
print
(
"GFY_CLICK "
+
String
(
data
:
data
,
encoding
:
.
utf8
)
!
)
}
print
(
"CampaignUrl url onclick: "
+
url
)
vc
.
campaignUrl
=
url
vc
.
params
=
params
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
if
let
sessionUuid
=
campaigns
[
indexPath
.
row
]
.
session_uuid
{
getSingleCampaignAsyncRequest
(
sessionUuid
:
sessionUuid
)
}
}
}
}
else
{
...
...
SwiftWarplyFramework/SwiftWarplyFramework/MFYViewController.swift
View file @
ec5edd9
...
...
@@ -325,7 +325,7 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{
}
}
}
else
if
(
campaign
.
_campaign_type
==
"coupon"
)
{
}
else
if
(
campaign
.
_campaign_type
==
"coupon"
&&
campaign
.
_couponset
!=
""
)
{
let
couponsetUuid
=
campaign
.
_couponset
if
(
couponsetUuid
!=
""
)
{
...
...
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
ec5edd9
...
...
@@ -6863,7 +6863,7 @@ public class swiftApi {
public
func
handleLoyaltyCampaigns
(
_
campaign
:
CampaignItemModel
,
_
controller
:
UIViewController
)
->
Void
{
if
(
campaign
.
_campaign_type
==
"coupon"
)
{
if
(
campaign
.
_campaign_type
==
"coupon"
&&
campaign
.
_couponset
!=
""
)
{
let
couponsetUuid
=
campaign
.
_couponset
if
(
couponsetUuid
!=
""
)
{
...
...
Please
register
or
login
to post a comment