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-11-01 14:09:25 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
249ff6110deb259595066755a57aafc3d44296c6
249ff611
1 parent
680e2dfc
getSingleCampaignAsync optimizations
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
19 deletions
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
249ff61
...
...
@@ -1279,7 +1279,7 @@ public class swiftApi {
public
var
subtitle
:
String
?
public
let
session_uuid
:
String
?
public
let
subcategory
:
String
?
public
let
is_new
:
Bool
?
public
var
is_new
:
Bool
?
public
var
message
:
String
?
public
let
loyaltyCampaignId
:
String
?
public
let
hasExtraFields
:
Bool
?
...
...
@@ -8267,16 +8267,19 @@ public class swiftApi {
func
getSingleCampaignAsyncCallback
(
_
getSingleCampaignData
:
[
AnyHashable
:
Any
]?)
->
Void
{
swiftApi
()
.
getCampaignsAsyncNew
(
language
:
"en"
,
filters
:
[
String
:
Any
](),
getCampaignsCallback
,
failureCallback
:
{
errorCode
in
})
//
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
{
}
}
// func getCampaignsCallback (_ campaignsData: Array<swiftApi.CampaignItemModel>?) -> Void {
// if (campaignsData != nil) {
// DispatchQueue.main.async {
// SwiftEventBus.post("campaigns_retrieved")
// }
// } else {
// }
// }
swiftApi
()
.
updateCampaign
(
sessionUuid
:
sessionUuid
)
SwiftEventBus
.
post
(
"campaigns_retrieved"
)
if
let
getSingleCampaignDataDictionary
=
getSingleCampaignData
as?
[
String
:
Any
]
{
...
...
@@ -8304,16 +8307,19 @@ public class swiftApi {
func
getSingleCampaignFailureCallback
(
_
error
:
Error
?)
->
Void
{
swiftApi
()
.
getCampaignsAsyncNew
(
language
:
"en"
,
filters
:
[
String
:
Any
](),
getCampaignsCallback
,
failureCallback
:
{
errorCode
in
})
//
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
{
}
}
// func getCampaignsCallback (_ campaignsData: Array<swiftApi.CampaignItemModel>?) -> Void {
// if (campaignsData != nil) {
// DispatchQueue.main.async {
// SwiftEventBus.post("campaigns_retrieved")
// }
// } else {
// }
// }
swiftApi
()
.
updateCampaign
(
sessionUuid
:
sessionUuid
)
SwiftEventBus
.
post
(
"campaigns_retrieved"
)
print
(
"getSingleCampaign error: "
)
print
(
error
)
...
...
@@ -9277,6 +9283,26 @@ public class swiftApi {
swiftApi
()
.
setCarouselList
(
carouselArray
)
}
public
func
updateCampaign
(
sessionUuid
:
String
)
{
let
allCampaigns
=
swiftApi
()
.
getAllCampaignList
()
for
tempCampaign
in
allCampaigns
{
if
(
tempCampaign
.
session_uuid
==
sessionUuid
)
{
tempCampaign
.
is_new
=
false
break
;
}
}
swiftApi
()
.
setUniqueCampaignList
(
allCampaigns
)
let
carouselArray
=
swiftApi
()
.
getCarouselList
()
for
tempCampaign
in
carouselArray
{
if
(
tempCampaign
.
session_uuid
==
sessionUuid
)
{
tempCampaign
.
is_new
=
false
break
;
}
}
swiftApi
()
.
setCarouselList
(
carouselArray
)
}
public
func
getCampaignsAsyncNewInternal
(
_
getCampaignsCallback
:
@escaping
(
_
campaignsData
:
Array
<
CampaignItemModel
>
?)
->
Void
,
failureCallback
:
@escaping
(
_
errorCode
:
Int
)
->
Void
)
->
Void
{
var
campaignsArray
=
swiftApi
()
.
getAllCampaignList
()
swiftApi
()
.
getAvailableCouponsAsync
({
responseDataAvailability
in
...
...
Please
register
or
login
to post a comment