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-13 17:53:32 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e03a451cacb0e7c4d442e181a0441ad542031e20
e03a451c
1 parent
94a0e139
add CCMS_CLICK, GFY_CLICK logs
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
16 deletions
SwiftWarplyFramework/SwiftWarplyFramework/GiftsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/MFYViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/GiftsViewController.swift
View file @
e03a451
...
...
@@ -109,20 +109,11 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
var
url
=
""
let
isCcmsOffer
=
(
campaigns
[
indexPath
.
row
]
.
ccms_offer
!=
nil
)
&&
(
campaigns
[
indexPath
.
row
]
.
ccms_offer
!=
""
)
&&
(
campaigns
[
indexPath
.
row
]
.
ccms_offer
==
"true"
)
// TODO: DELETE
print
(
"isCcmsOffer: "
+
(
isCcmsOffer
?
"true"
:
"false"
))
if
(
isCcmsOffer
)
{
let
ccmsCampaigns
=
swiftApi
()
.
getCCMSLoyaltyCampaigns
()
// TODO: DELETE
print
(
"ccmsCampaigns count: "
+
String
(
ccmsCampaigns
.
count
))
let
loyaltyCampaignIdExists
=
ccmsCampaigns
.
contains
{
$0
.
_loyaltyCampaignId
==
campaigns
[
indexPath
.
row
]
.
session_uuid
}
// TODO: DELETE
print
(
"loyaltyCampaignIdExists: "
+
(
loyaltyCampaignIdExists
?
"true"
:
"false"
))
if
(
loyaltyCampaignIdExists
==
true
)
{
var
ccmsCampaignFound
:
swiftApi
.
LoyaltyContextualOfferModel
=
swiftApi
.
LoyaltyContextualOfferModel
()
for
item
in
ccmsCampaigns
{
...
...
@@ -132,18 +123,25 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
}
url
=
swiftApi
()
.
constructCcmsUrl
(
campaigns
[
indexPath
.
row
],
ccmsCampaignFound
)
// TODO: DELETE
print
(
"ccmsCampaignFound: "
+
ccmsCampaignFound
.
_loyaltyCampaignId
)
}
else
{
url
=
swiftApi
()
.
constructCampaignUrl
(
campaigns
[
indexPath
.
row
])
// TODO: DELETE
print
(
"loyaltyCampaignId DOESNT Exist"
)
}
let
encoder
=
JSONEncoder
()
encoder
.
outputFormatting
=
.
prettyPrinted
let
data
=
try!
encoder
.
encode
(
campaigns
[
indexPath
.
row
])
print
(
"CCMS_CLICK "
+
String
(
data
:
data
,
encoding
:
.
utf8
)
!
)
}
else
{
url
=
swiftApi
()
.
constructCampaignUrl
(
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
...
...
SwiftWarplyFramework/SwiftWarplyFramework/MFYViewController.swift
View file @
e03a451
...
...
@@ -92,10 +92,53 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{
}
}
else
{
// let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
// let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as! SwiftWarplyFramework.CampaignViewController
// let url = swiftApi().constructCampaignUrl(campaigns[indexPath.row])
// print("CampaignUrl url onclick: " + url)
// vc.campaignUrl = url
// self.navigationController?.pushViewController(vc, animated: true)
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"CampaignViewController"
)
as!
SwiftWarplyFramework
.
CampaignViewController
let
url
=
swiftApi
()
.
constructCampaignUrl
(
campaigns
[
indexPath
.
row
])
print
(
"CampaignUrl url onclick: "
+
url
)
var
url
=
""
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
}
}
url
=
swiftApi
()
.
constructCcmsUrl
(
campaigns
[
indexPath
.
row
],
ccmsCampaignFound
)
}
else
{
url
=
swiftApi
()
.
constructCampaignUrl
(
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
{
url
=
swiftApi
()
.
constructCampaignUrl
(
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
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
...
...
Please
register
or
login
to post a comment