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-10-04 18:37:06 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2e6a31b348abe6f79e8a046e9f7beb51a53bd313
2e6a31b3
1 parent
9bf0525e
add firebase events v1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
3 deletions
SwiftWarplyFramework/SwiftWarplyFramework/CampaignViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/GiftsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/MFYViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/WalletViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/CampaignViewController.swift
View file @
2e6a31b
...
...
@@ -235,6 +235,11 @@ var timer2: DispatchSourceTimer?
SwiftEventBus
.
post
(
"pacing"
,
sender
:
pacingEvent
)
if
(
swiftApi
()
.
getTrackingStepsEnabled
()
==
false
)
{
let
firebaseEvent
=
swiftApi
.
LoyaltySDKFirebaseEventModel
()
firebaseEvent
.
_eventName
=
"lovalty_steps_activation"
firebaseEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"firebase"
,
sender
:
firebaseEvent
)
self
.
startTrackingSteps
()
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/GiftsViewController.swift
View file @
2e6a31b
...
...
@@ -151,6 +151,13 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
public
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
if
(
campaigns
[
indexPath
.
row
]
.
_ccms
!=
nil
)
{
let
firebaseEvent
=
swiftApi
.
LoyaltySDKFirebaseEventModel
()
firebaseEvent
.
_eventName
=
"loyalty_sdk_offer_selected"
firebaseEvent
.
setParameter
=
(
"name"
,
(
campaigns
[
indexPath
.
row
]
.
_ccms
?
.
_title
??
""
))
firebaseEvent
.
setParameter
=
(
"type"
,
"gift"
)
SwiftEventBus
.
post
(
"firebase"
,
sender
:
firebaseEvent
)
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"ContextualViewController"
)
as!
SwiftWarplyFramework
.
ContextualViewController
vc
.
ccms
=
campaigns
[
indexPath
.
row
]
.
_ccms
...
...
@@ -189,6 +196,13 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
for
item
in
couponsetsList
{
if
(
item
.
uuid
==
couponsetUuid
)
{
let
firebaseEvent
=
swiftApi
.
LoyaltySDKFirebaseEventModel
()
firebaseEvent
.
_eventName
=
"loyalty_sdk_offer_selected"
firebaseEvent
.
setParameter
=
(
"name"
,
(
item
?
.
name
??
""
))
firebaseEvent
.
setParameter
=
(
"type"
,
"coupon"
)
SwiftEventBus
.
post
(
"firebase"
,
sender
:
firebaseEvent
)
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"CouponViewController"
)
as!
SwiftWarplyFramework
.
CouponViewController
vc
.
couponset
=
item
...
...
SwiftWarplyFramework/SwiftWarplyFramework/MFYViewController.swift
View file @
2e6a31b
...
...
@@ -125,6 +125,13 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{
public
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
if
(
campaigns
[
indexPath
.
row
]
.
_ccms
!=
nil
)
{
let
firebaseEvent
=
swiftApi
.
LoyaltySDKFirebaseEventModel
()
firebaseEvent
.
_eventName
=
"loyalty_sdk_offer_selected"
firebaseEvent
.
setParameter
=
(
"name"
,
(
campaigns
[
indexPath
.
row
]
.
_ccms
?
.
_title
??
""
))
firebaseEvent
.
setParameter
=
(
"type"
,
"gift"
)
SwiftEventBus
.
post
(
"firebase"
,
sender
:
firebaseEvent
)
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"ContextualViewController"
)
as!
SwiftWarplyFramework
.
ContextualViewController
vc
.
ccms
=
campaigns
[
indexPath
.
row
]
.
_ccms
...
...
@@ -162,6 +169,13 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{
for
item
in
couponsetsList
{
if
(
item
.
uuid
==
couponsetUuid
)
{
let
firebaseEvent
=
swiftApi
.
LoyaltySDKFirebaseEventModel
()
firebaseEvent
.
_eventName
=
"loyalty_sdk_offer_selected"
firebaseEvent
.
setParameter
=
(
"name"
,
(
item
?
.
name
??
""
))
firebaseEvent
.
setParameter
=
(
"type"
,
"coupon"
)
SwiftEventBus
.
post
(
"firebase"
,
sender
:
firebaseEvent
)
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"CouponViewController"
)
as!
SwiftWarplyFramework
.
CouponViewController
vc
.
couponset
=
item
...
...
SwiftWarplyFramework/SwiftWarplyFramework/WalletViewController.swift
View file @
2e6a31b
...
...
@@ -375,9 +375,19 @@ import SwiftEventBus
let
dealsAnalysis
=
swiftApi
.
WarplyDealsAnalysisEventModel
()
dealsAnalysis
.
_isPressed
=
true
SwiftEventBus
.
post
(
"analysis_pressed"
,
sender
:
dealsAnalysis
)
let
firebaseEvent
=
swiftApi
.
LoyaltySDKFirebaseEventModel
()
firebaseEvent
.
_eventName
=
"did_tap_gifts_for_you_badge"
firebaseEvent
.
setParameter
=
(
"screen"
,
"Loyalty Wallet"
)
SwiftEventBus
.
post
(
"firebase"
,
sender
:
firebaseEvent
)
}
@IBAction
func
couponEarnButtonAction
(
_
sender
:
Any
)
{
let
firebaseEvent
=
swiftApi
.
LoyaltySDKFirebaseEventModel
()
firebaseEvent
.
_eventName
=
"did_tap_deals_for_you_badge"
firebaseEvent
.
setParameter
=
(
"screen"
,
"Loyalty Wallet"
)
SwiftEventBus
.
post
(
"firebase"
,
sender
:
firebaseEvent
)
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"LoyaltyAnalysisViewController"
)
as!
SwiftWarplyFramework
.
LoyaltyAnalysisViewController
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
...
...
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
2e6a31b
...
...
@@ -2675,7 +2675,7 @@ public class swiftApi {
public
class
LoyaltySDKFirebaseEventModel
{
private
var
eventName
:
String
private
var
parameters
:
[
String
:
String
]
private
var
parameters
:
[
String
:
String
]
?
public
init
()
{
...
...
@@ -2693,7 +2693,7 @@ public class swiftApi {
}
}
public
var
_parameters
:
[
String
:
String
]
{
public
var
_parameters
:
[
String
:
String
]
?
{
get
{
// getter
return
self
.
parameters
}
...
...
@@ -2709,7 +2709,7 @@ public class swiftApi {
return
(
key
:
""
,
value
:
""
)
}
set
(
newValue
)
{
//setter
self
.
parameters
.
updateValue
(
newValue
.
1
,
forKey
:
newValue
.
0
)
self
.
parameters
?
.
updateValue
(
newValue
.
1
,
forKey
:
newValue
.
0
)
}
}
...
...
@@ -4936,6 +4936,13 @@ public class swiftApi {
for
item
in
couponsetsList
{
if
(
item
.
uuid
==
couponsetUuid
)
{
let
firebaseEvent
=
swiftApi
.
LoyaltySDKFirebaseEventModel
()
firebaseEvent
.
_eventName
=
"loyalty_sdk_offer_selected"
firebaseEvent
.
setParameter
=
(
"name"
,
(
item
.
name
??
""
))
firebaseEvent
.
setParameter
=
(
"type"
,
"coupon"
)
SwiftEventBus
.
post
(
"firebase"
,
sender
:
firebaseEvent
)
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"CouponViewController"
)
as!
SwiftWarplyFramework
.
CouponViewController
vc
.
couponset
=
item
...
...
@@ -4983,6 +4990,13 @@ public class swiftApi {
// if (((ccms._loyaltyCampaignId == "") || (ccms._loyaltyCampaignId == "NA")) && ((ccms._zone == "COSMOTE_APP_GIFTS4U") || (ccms._zone == "COSMOTE_APP_MORE4U"))) {
if
((
ccms
.
_loyaltyCampaignId
==
""
)
||
(
ccms
.
_loyaltyCampaignId
==
"NA"
))
{
let
firebaseEvent
=
swiftApi
.
LoyaltySDKFirebaseEventModel
()
firebaseEvent
.
_eventName
=
"loyalty_sdk_offer_selected"
firebaseEvent
.
setParameter
=
(
"name"
,
(
ccms
.
_title
))
firebaseEvent
.
setParameter
=
(
"type"
,
"gift"
)
SwiftEventBus
.
post
(
"firebase"
,
sender
:
firebaseEvent
)
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"ContextualViewController"
)
as!
SwiftWarplyFramework
.
ContextualViewController
vc
.
ccms
=
ccms
...
...
Please
register
or
login
to post a comment