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-08-01 18:33:52 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
107067367e9c172fb5b2e49418445f35ede870ea
10706736
1 parent
20020b51
handleLoyaltyCampaigns, handleContextualCampaigns
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
0 deletions
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
1070673
...
...
@@ -3678,4 +3678,64 @@ public class swiftApi {
}
}
public
func
handleLoyaltyCampaigns
(
_
campaign
:
CampaignItemModel
,
_
controller
:
UIViewController
)
->
Void
{
if
(
campaign
.
_campaign_type
==
"coupon"
)
{
let
couponsetUuid
=
campaign
.
_couponset
if
(
couponsetUuid
!=
""
)
{
let
couponsetsList
=
swiftApi
()
.
getCouponSetList
()
for
item
in
couponsetsList
{
if
(
item
.
uuid
==
couponsetUuid
)
{
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
;
}
}
}
}
else
{
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"CampaignViewController"
)
as!
SwiftWarplyFramework
.
CampaignViewController
vc
.
campaignUrl
=
swiftApi
()
.
constructCampaignUrl
(
campaign
)
controller
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
}
public
func
handleContextualCampaigns
(
_
ccms
:
LoyaltyContextualOfferModel
,
_
controller
:
UIViewController
)
->
Void
{
let
allCampaigns
=
swiftApi
()
.
getAllCampaignList
()
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"
)
if
(
isCcmsOffer
&&
(
loyaltyCampaign
.
session_uuid
==
ccms
.
_loyaltyCampaignId
))
{
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
)
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