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-04-02 12:10:25 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
982e408302a661bc5ed6ff5d6482721bf46af5ef
982e4083
1 parent
c92daf10
webview sm coupons and active coupons fixes
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
9 deletions
SwiftWarplyFramework/SwiftWarplyFramework/CampaignViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/CampaignViewController.swift
View file @
982e408
...
...
@@ -749,7 +749,17 @@ var timer2: DispatchSourceTimer?
}
else
if
(
eventArray
[
1
]
==
"loyaltyWallet"
)
{
// event:loyaltyWallet
SwiftEventBus
.
post
(
"refresh_vouchers"
)
SwiftEventBus
.
post
(
"open_my_rewards"
)
// SwiftEventBus.post("open_my_rewards")
swiftApi
()
.
getUnifiedCouponsDeals
{
unifiedCoupons
in
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"UnifiedCouponsViewController"
)
as!
SwiftWarplyFramework
.
UnifiedCouponsViewController
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
failureCallback
:
{
errorCode
in
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"UnifiedCouponsViewController"
)
as!
SwiftWarplyFramework
.
UnifiedCouponsViewController
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
// let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
// let vc = storyboard.instantiateViewController(withIdentifier: "WalletViewController") as! SwiftWarplyFramework.WalletViewController
...
...
@@ -803,14 +813,33 @@ var timer2: DispatchSourceTimer?
}
else
if
(
eventArray
[
1
]
==
"activeCoupons"
)
{
// event:activeCoupons
swiftApi
()
.
getUnifiedCouponsDeals
{
unifiedCoupons
in
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"UnifiedCouponsViewController"
)
as!
SwiftWarplyFramework
.
UnifiedCouponsViewController
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
failureCallback
:
{
errorCode
in
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"UnifiedCouponsViewController"
)
as!
SwiftWarplyFramework
.
UnifiedCouponsViewController
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
swiftApi
()
.
getCouponsAsync
(
getCouponsCallback
,
failureCallback
:
{
errorCode
in
})
func
getCouponsCallback
(
_
couponsData
:
Array
<
swiftApi
.
CouponItemModel
>
?)
->
Void
{
if
(
couponsData
!=
nil
)
{
DispatchQueue
.
main
.
async
{
SwiftEventBus
.
post
(
"coupons_fetched"
)
}
}
else
{
}
}
swiftApi
()
.
getCampaignsAsyncNew
(
language
:
"en"
,
filters
:
[
String
:
Any
](),
getCampaignsCallback
,
failureCallback
:
{
errorCode
in
})
func
getCampaignsCallback
(
_
campaignsData
:
Array
<
swiftApi
.
CampaignItemModel
>
?)
->
Void
{
if
(
campaignsData
!=
nil
)
{
DispatchQueue
.
main
.
async
{
SwiftEventBus
.
post
(
"campaigns_retrieved"
)
}
}
else
{
}
}
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
1.5
)
{
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
SwiftWarplyFramework
.
CouponsViewController
.
self
))
if
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"CouponsViewController"
)
as?
SwiftWarplyFramework
.
CouponsViewController
{
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
}
}
...
...
Please
register
or
login
to post a comment