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-09-02 16:27:16 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
51b30ab547d9afba01d30d589215fc9ef55f413b
51b30ab5
1 parent
92c0e9e2
fix handleContextualCampaigns
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
18 deletions
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
51b30ab
...
...
@@ -4506,30 +4506,41 @@ public class swiftApi {
public
func
handleContextualCampaigns
(
_
ccms
:
LoyaltyContextualOfferModel
,
_
controller
:
UIViewController
)
->
Void
{
let
allCampaigns
=
swiftApi
()
.
getAllCampaignList
()
// if (((ccms._loyaltyCampaignId == "") || (ccms._loyaltyCampaignId == "NA")) && ((ccms._zone == "COSMOTE_APP_GIFTS4U") || (ccms._zone == "COSMOTE_APP_MORE4U"))) {
if
((
ccms
.
_loyaltyCampaignId
==
""
)
||
(
ccms
.
_loyaltyCampaignId
==
"NA"
))
{
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"ContextualViewController"
)
as!
SwiftWarplyFramework
.
ContextualViewController
vc
.
ccms
=
ccms
controller
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
for
loyaltyCampaign
in
allCampaigns
{
let
isCcmsOffer
=
(
loyaltyCampaign
.
ccms_offer
!=
nil
)
&&
(
loyaltyCampaign
.
ccms_offer
!=
""
)
&&
(
loyaltyCampaign
.
ccms_offer
==
"true"
)
let
isTelco
=
(
loyaltyCampaign
.
_type
!=
nil
&&
loyaltyCampaign
.
_type
==
"telco"
)
}
else
{
if
(
isCcmsOffer
&&
(
loyaltyCampaign
.
session_uuid
==
ccms
.
_loyaltyCampaignId
))
{
let
allCampaigns
=
swiftApi
()
.
getAllCampaignList
()
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"CampaignViewController"
)
as!
SwiftWarplyFramework
.
CampaignViewController
vc
.
campaignUrl
=
swiftApi
()
.
constructCcmsUrl
(
loyaltyCampaign
,
ccms
)
vc
.
params
=
swiftApi
()
.
constructCcmsParams
(
loyaltyCampaign
,
ccms
)
controller
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
break
;
for
loyaltyCampaign
in
allCampaigns
{
let
isCcmsOffer
=
(
loyaltyCampaign
.
ccms_offer
!=
nil
)
&&
(
loyaltyCampaign
.
ccms_offer
!=
""
)
&&
(
loyaltyCampaign
.
ccms_offer
==
"true"
)
let
isTelco
=
(
loyaltyCampaign
.
_type
!=
nil
&&
loyaltyCampaign
.
_type
==
"telco"
)
}
else
if
(
isTelco
&&
(
loyaltyCampaign
.
session_uuid
==
ccms
.
_loyaltyCampaignId
))
{
if
(
isCcmsOffer
&&
(
loyaltyCampaign
.
session_uuid
==
ccms
.
_loyaltyCampaignId
))
{
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"TelcoViewController"
)
as!
SwiftWarplyFramework
.
Telco
ViewController
vc
.
ccms
=
ccms
vc
.
campaign
=
loyaltyCampaign
controller
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
break
;
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"CampaignViewController"
)
as!
SwiftWarplyFramework
.
Campaign
ViewController
vc
.
campaignUrl
=
swiftApi
()
.
constructCcmsUrl
(
loyaltyCampaign
,
ccms
)
vc
.
params
=
swiftApi
()
.
constructCcmsParams
(
loyaltyCampaign
,
ccms
)
controller
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
break
;
}
else
if
(
isTelco
&&
(
loyaltyCampaign
.
session_uuid
==
ccms
.
_loyaltyCampaignId
))
{
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"TelcoViewController"
)
as!
SwiftWarplyFramework
.
TelcoViewController
vc
.
ccms
=
ccms
vc
.
campaign
=
loyaltyCampaign
controller
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
break
;
}
}
}
}
...
...
Please
register
or
login
to post a comment