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-21 18:10:18 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
93f15510a50ca37c3be1f3ab49154ffa9c3fba78
93f15510
1 parent
a1befabb
add dynatrace events
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
395 additions
and
0 deletions
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
93f1551
...
...
@@ -506,6 +506,12 @@ public class swiftApi {
couponSets
=
couponSetsData
??
[
""
:
""
]
if
let
myCouponsSetsDictionary
=
couponSets
as?
[
String
:
AnyObject
]
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_success_couponset_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
let
couponSetsData
=
(
myCouponsSetsDictionary
[
"MAPP_COUPON"
]
as!
NSArray
)
for
couponset
in
couponSetsData
{
...
...
@@ -513,6 +519,11 @@ public class swiftApi {
couponSetsArray
.
append
(
tempCouponset
)
}
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_couponset_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
}
swiftApi
()
.
setCouponSetList
(
couponSetsArray
)
...
...
@@ -521,6 +532,12 @@ public class swiftApi {
func
couponSetsFailureCallback
(
_
error
:
Error
?)
->
Void
{
print
(
"getCouponSets error: "
)
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_couponset_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
getCouponSetsCallback
(
nil
)
}
...
...
@@ -660,6 +677,11 @@ public class swiftApi {
func
couponsCallback
(
_
couponsData
:
[
AnyHashable
:
Any
]?)
->
Void
{
coupons
=
couponsData
??
[
""
:
""
]
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_success_user_coupons_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
// On Coupons request success, make CouponSets request
instanceOfMyApi
.
getCouponsetsAsync
(
true
,
andVisible
:
true
,
andUuids
:
nil
,
couponSetsCallback
,
failureBlock
:
couponSetsFailureCallback
)
...
...
@@ -667,6 +689,12 @@ public class swiftApi {
func
couponsFailureCallback
(
_
error
:
Error
?)
->
Void
{
print
(
"getCoupons error: "
)
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_user_coupons_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
getCouponsCallback
(
nil
)
}
...
...
@@ -674,6 +702,11 @@ public class swiftApi {
couponSets
=
couponSetsData
??
[
""
:
""
]
if
let
myCouponsSetsDictionary
=
couponSets
as?
[
String
:
AnyObject
]
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_success_couponset_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
let
couponSetsData
=
(
myCouponsSetsDictionary
[
"MAPP_COUPON"
]
as!
NSArray
)
for
couponset
in
couponSetsData
{
...
...
@@ -681,6 +714,11 @@ public class swiftApi {
couponSetsArray
.
append
(
tempCouponset
)
}
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_couponset_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
}
swiftApi
()
.
setCouponSetList
(
couponSetsArray
)
...
...
@@ -712,6 +750,12 @@ public class swiftApi {
func
couponSetsFailureCallback
(
_
error
:
Error
?)
->
Void
{
print
(
"getCouponSets error: "
)
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_couponset_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
getCouponsCallback
(
nil
)
}
...
...
@@ -1145,6 +1189,11 @@ public class swiftApi {
if
let
responseDataDictionary
=
campaignsData
as?
[
String
:
AnyObject
]
{
if
(
responseDataDictionary
[
"MAPP_CAMPAIGNING-status"
]
as?
Int
==
1
)
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_success_campaigns_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
if
let
responseDataMapp
=
responseDataDictionary
[
"MAPP_CAMPAIGNING"
]
as?
[
String
:
Any
]
{
if
let
responseDataCampaigns
=
responseDataMapp
[
"campaigns"
]
as?
[[
String
:
Any
]?]
{
...
...
@@ -1195,10 +1244,20 @@ public class swiftApi {
})
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_campaigns_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
getCampaignsCallback
(
nil
)
}
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_campaigns_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
getCampaignsCallback
(
nil
)
}
}
...
...
@@ -1207,6 +1266,12 @@ public class swiftApi {
print
(
"getCampaigns error: "
)
print
(
error
)
print
(
"===================="
)
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_campaigns_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
getCampaignsCallback
(
nil
)
}
}
...
...
@@ -1223,6 +1288,11 @@ public class swiftApi {
if
let
responseDataDictionary
=
campaignsData
as?
[
String
:
AnyObject
]
{
if
(
responseDataDictionary
[
"status"
]
as?
Int
==
1
)
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_success_campaigns_personalized_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
if
let
responseDataContext
=
responseDataDictionary
[
"context"
]
as?
[
String
:
Any
]
{
...
...
@@ -1252,10 +1322,20 @@ public class swiftApi {
getCampaignsCallback
(
nil
)
}
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_campaigns_personalized_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
getCampaignsCallback
(
nil
)
}
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_campaigns_personalized_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
getCampaignsCallback
(
nil
)
}
}
...
...
@@ -1264,6 +1344,12 @@ public class swiftApi {
print
(
"getCampaignsPersonalized error: "
)
print
(
error
)
print
(
"===================="
)
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_campaigns_personalized_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
getCampaignsCallback
(
nil
)
}
}
...
...
@@ -2260,6 +2346,11 @@ public class swiftApi {
func
profileCallback
(
_
profileData
:
[
AnyHashable
:
Any
]?)
->
Void
{
if
let
profileDataDictionary
=
profileData
as?
[
String
:
AnyObject
]
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_success_profile_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
let
profileDataResult
=
(
profileDataDictionary
[
"result"
]
as?
[
String
:
Any
]
??
[
""
:
""
])
let
tempProfile
=
ProfileModel
(
dictionary
:
profileDataResult
)
...
...
@@ -2273,6 +2364,11 @@ public class swiftApi {
getProfileCallback
(
tempProfile
);
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_profile_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
getProfileCallback
(
nil
)
}
...
...
@@ -2280,6 +2376,12 @@ public class swiftApi {
func
profileFailureCallback
(
_
error
:
Error
?)
->
Void
{
print
(
"getProfile error: "
)
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_profile_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
getProfileCallback
(
nil
)
}
...
...
@@ -2329,6 +2431,11 @@ public class swiftApi {
func
verifyAsyncCallback
(
_
verifyTicketData
:
[
AnyHashable
:
Any
]?)
->
Void
{
if
let
verifyTicketDataDictionary
=
verifyTicketData
as?
[
String
:
Any
]
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_success_login_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
let
tempResponse
=
VerifyTicketResponseModel
(
dictionary
:
verifyTicketDataDictionary
)
...
...
@@ -2337,6 +2444,11 @@ public class swiftApi {
swiftApi
()
.
getProfileAsync
(
getProfileCallback
)
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_login_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
verifyTicketCallback
(
nil
)
}
...
...
@@ -2346,6 +2458,12 @@ public class swiftApi {
print
(
"verifyTicket error: "
)
print
(
error
)
print
(
"===================="
)
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_login_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
verifyTicketCallback
(
nil
)
}
...
...
@@ -2740,6 +2858,49 @@ public class swiftApi {
}
}
public
class
LoyaltySDKDynatraceEventModel
{
private
var
eventName
:
String
private
var
parameters
:
[
String
:
String
]?
public
init
()
{
self
.
eventName
=
""
self
.
parameters
=
[
String
:
String
]()
}
public
var
_eventName
:
String
{
get
{
// getter
return
self
.
eventName
}
set
(
newValue
)
{
//setter
self
.
eventName
=
newValue
}
}
public
var
_parameters
:
[
String
:
String
]?
{
get
{
// getter
return
self
.
parameters
}
set
(
newValue
)
{
//setter
self
.
parameters
=
newValue
}
}
public
var
setParameter
:
(
key
:
String
,
value
:
String
)
{
@available(*, unavailable)
get
{
// fatalError("You cannot read from this object.")
return
(
key
:
""
,
value
:
""
)
}
set
(
newValue
)
{
//setter
self
.
parameters
?
.
updateValue
(
newValue
.
1
,
forKey
:
newValue
.
0
)
}
}
}
public
func
constructCampaignUrl
(
_
campaign
:
CampaignItemModel
)
->
String
{
let
instanceOfMyApi
=
MyApi
()
...
...
@@ -4627,14 +4788,29 @@ public class swiftApi {
if
((
responseDataDictionary
[
"status"
]
as?
Int
==
1
)
||
(
responseDataDictionary
[
"status"
]
as?
Int
==
4
)
||
(
responseDataDictionary
[
"status"
]
as?
Int
==
5
)
||
(
responseDataDictionary
[
"status"
]
as?
Int
==
7
))
{
// let responseDataResult = (responseDataDictionary["result"] as? [String: Any] ?? [String: Any]())
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_success_sharing_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
let
tempResponse
=
SharingResponseModel
(
dictionary
:
responseDataDictionary
)
cosmoteSharingCallback
(
tempResponse
);
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_sharing_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
cosmoteSharingCallback
(
nil
)
}
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_sharing_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
cosmoteSharingCallback
(
nil
)
}
...
...
@@ -4644,6 +4820,12 @@ public class swiftApi {
print
(
"cosmoteSharing error: "
)
print
(
error
)
print
(
"===================="
)
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_sharing_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
cosmoteSharingCallback
(
nil
)
}
}
...
...
@@ -4658,6 +4840,12 @@ public class swiftApi {
if
let
responseDataDictionary
=
responseData
as?
[
String
:
AnyObject
]
{
if
(
responseDataDictionary
[
"status"
]
as?
Int
==
1
)
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_success_retrieve_sharing_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
if
let
responseDataDictionary
=
responseData
as?
[
String
:
Any
]
{
let
tempResponse
=
GenericResponseModel
(
dictionary
:
responseDataDictionary
)
...
...
@@ -4668,10 +4856,20 @@ public class swiftApi {
}
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_retrieve_sharing_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
cosmoteSharingCallback
(
nil
)
}
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_retrieve_sharing_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
cosmoteSharingCallback
(
nil
)
}
...
...
@@ -4681,6 +4879,12 @@ public class swiftApi {
print
(
"cosmoteRetrieveSharing error: "
)
print
(
error
)
print
(
"===================="
)
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_retrieve_sharing_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
cosmoteSharingCallback
(
nil
)
}
}
...
...
@@ -4734,9 +4938,37 @@ public class swiftApi {
let
tempResponse
=
GenericResponseModel
(
dictionary
:
responseDataDictionary
)
if
(
tempResponse
!=
nil
)
{
DispatchQueue
.
main
.
async
{
if
(
tempResponse
.
getStatus
==
1
)
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_success_coupon_sharing_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_coupon_sharing_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
}
}
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_coupon_sharing_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
}
couponSharingCallback
(
tempResponse
);
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_coupon_sharing_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
couponSharingCallback
(
nil
)
}
...
...
@@ -4746,6 +4978,12 @@ public class swiftApi {
print
(
"cosmoteCouponSharing error: "
)
print
(
error
)
print
(
"===================="
)
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_coupon_sharing_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
couponSharingCallback
(
nil
)
}
}
...
...
@@ -4762,9 +5000,37 @@ public class swiftApi {
let
tempResponse
=
GenericResponseModel
(
dictionary
:
responseDataDictionary
)
if
(
tempResponse
!=
nil
)
{
DispatchQueue
.
main
.
async
{
if
(
tempResponse
.
getStatus
==
1
)
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_success_submit_order_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_submit_order_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
}
}
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_submit_order_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
}
submitOrderCallback
(
tempResponse
);
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_submit_order_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
submitOrderCallback
(
nil
)
}
...
...
@@ -4774,6 +5040,12 @@ public class swiftApi {
print
(
"submitOrder error: "
)
print
(
error
)
print
(
"===================="
)
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_submit_order_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
submitOrderCallback
(
nil
)
}
}
...
...
@@ -4790,9 +5062,37 @@ public class swiftApi {
let
tempResponse
=
GenericResponseModel
(
dictionary
:
responseDataDictionary
)
if
(
tempResponse
!=
nil
)
{
DispatchQueue
.
main
.
async
{
if
(
tempResponse
.
getStatus
==
1
)
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_success_post_event_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_post_event_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
}
}
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_post_event_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
}
postEventCallback
(
tempResponse
);
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_post_event_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
postEventCallback
(
nil
)
}
...
...
@@ -4802,6 +5102,12 @@ public class swiftApi {
print
(
"postEvent error: "
)
print
(
error
)
print
(
"===================="
)
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_post_event_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
postEventCallback
(
nil
)
}
}
...
...
@@ -4976,6 +5282,11 @@ public class swiftApi {
if
let
responseDataDictionary
=
sharingHistoryData
as?
[
String
:
AnyObject
]
{
if
(
responseDataDictionary
[
"status"
]
as?
Int
==
1
)
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_success_sharing_history_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
if
let
responseDataResult
=
responseDataDictionary
[
"result"
]
as?
[[
String
:
Any
]?]
{
...
...
@@ -5001,10 +5312,20 @@ public class swiftApi {
}
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_sharing_history_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
getSharingHistoryCallback
(
nil
)
}
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_sharing_history_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
getSharingHistoryCallback
(
nil
)
}
}
...
...
@@ -5013,6 +5334,12 @@ public class swiftApi {
print
(
"getSharingHistory error: "
)
print
(
error
)
print
(
"===================="
)
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_sharing_history_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
getSharingHistoryCallback
(
nil
)
}
}
...
...
@@ -5172,6 +5499,11 @@ public class swiftApi {
if
let
responseDataDictionary
=
getMerchantsData
as?
[
String
:
AnyObject
]
{
if
(
responseDataDictionary
[
"MAPP_SHOPS-status"
]
as?
Int
==
1
)
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_success_shops_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
if
let
responseDataMappShops
=
responseDataDictionary
[
"MAPP_SHOPS"
]
as?
[
String
:
Any
]
{
...
...
@@ -5197,10 +5529,20 @@ public class swiftApi {
}
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_shops_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
getMerchantsCallback
(
nil
)
}
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_shops_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
getMerchantsCallback
(
nil
)
}
}
...
...
@@ -5209,6 +5551,12 @@ public class swiftApi {
print
(
"getMultilingualMerchants error: "
)
print
(
error
)
print
(
"===================="
)
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_shops_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
getMerchantsCallback
(
nil
)
}
}
...
...
@@ -5771,13 +6119,29 @@ public class swiftApi {
let
tempResponse
=
VerifyTicketResponseModel
(
dictionary
:
responseDataDictionary
)
if
(
tempResponse
.
getStatus
==
1
)
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_success_logout_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
swiftApi
()
.
setUserTag
(
""
)
swiftApi
()
.
setUserNonTelco
(
false
)
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_logout_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
}
logoutCallback
(
tempResponse
);
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_logout_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
logoutCallback
(
nil
)
}
}
...
...
@@ -5876,10 +6240,20 @@ public class swiftApi {
editProfileCallback
(
tempResponse
);
if
(
tempResponse
.
getStatus
==
1
)
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_success_edit_profile_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
swiftApi
()
.
getProfileAsync
(
getProfileCallback
)
}
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_edit_profile_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
editProfileCallback
(
nil
)
}
...
...
@@ -5889,6 +6263,12 @@ public class swiftApi {
print
(
"editProfile error: "
)
print
(
error
)
print
(
"===================="
)
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_edit_profile_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
editProfileCallback
(
nil
)
}
...
...
@@ -5961,9 +6341,18 @@ public class swiftApi {
getSingleCampaignCallback
(
tempResponse
);
if
(
tempResponse
.
getStatus
==
1
)
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_success_read_campaign_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
}
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_success_read_campaign_loyalty"
// custom_error_read_campaign_loyalty
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
getSingleCampaignCallback
(
nil
)
}
...
...
@@ -5985,6 +6374,12 @@ public class swiftApi {
print
(
"getSingleCampaign error: "
)
print
(
error
)
print
(
"===================="
)
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_success_read_campaign_loyalty"
// custom_error_read_campaign_loyalty
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
getSingleCampaignCallback
(
nil
)
}
}
...
...
Please
register
or
login
to post a comment