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
2023-01-16 19:11:39 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
abce72d6118521c5d324338d0a1c0498a1cc7c47
abce72d6
1 parent
cd7b7c7b
add failureCallbacks, sdk_session_expired events
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
66 additions
and
20 deletions
SwiftWarplyFramework/Pods/Pods.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
SwiftWarplyFramework/SwiftWarplyFramework.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/CampaignViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/ContextualViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/CouponViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/CouponsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/ShareViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/SharingHistoryViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/TelcoViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/Pods/Pods.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
abce72d
...
...
@@ -7,7 +7,7 @@
<key>
Pods-SwiftWarplyFramework.xcscheme_^#shared#^_
</key>
<dict>
<key>
orderHint
</key>
<integer>
0
</integer>
<integer>
1
</integer>
</dict>
</dict>
</dict>
...
...
SwiftWarplyFramework/SwiftWarplyFramework.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
abce72d
...
...
@@ -7,7 +7,7 @@
<key>
SwiftWarplyFramework.xcscheme_^#shared#^_
</key>
<dict>
<key>
orderHint
</key>
<integer>
1
</integer>
<integer>
0
</integer>
</dict>
</dict>
</dict>
...
...
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
abce72d
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/CampaignViewController.swift
View file @
abce72d
...
...
@@ -44,7 +44,7 @@ var timer2: DispatchSourceTimer?
dateFormatter
.
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
let
dateString
=
dateFormatter
.
string
(
from
:
currentDateTime
)
swiftApi
()
.
setPacingDetailsAsync
(
persistedSteps
,
dateString
,
setPacingDetailsAsyncCallback
)
swiftApi
()
.
setPacingDetailsAsync
(
persistedSteps
,
dateString
,
setPacingDetailsAsyncCallback
,
failureCallback
:
{
errorCode
in
}
)
}
func
setPacingDetailsAsyncCallback
(
_
responseData
:
swiftApi
.
GenericResponseModel
?)
->
Void
{
...
...
@@ -161,12 +161,12 @@ var timer2: DispatchSourceTimer?
}
else
if
(
eventArray
[
1
]
==
"addUserTag"
)
{
// SwiftEventBus.post("questionnaire", sender: questionnaireEvent)
swiftApi
()
.
getProfileAsync
(
getProfileCallback
)
swiftApi
()
.
getProfileAsync
(
getProfileCallback
,
failureCallback
:
{
errorCode
in
}
)
func
getProfileCallback
(
_
profileData
:
swiftApi
.
ProfileModel
?)
->
Void
{
if
(
profileData
!=
nil
)
{
DispatchQueue
.
main
.
async
{
swiftApi
()
.
getCampaignsAsyncNew
(
language
:
"en"
,
filters
:
[
String
:
Any
](),
getCampaignsCallback
)
swiftApi
()
.
getCampaignsAsyncNew
(
language
:
"en"
,
filters
:
[
String
:
Any
](),
getCampaignsCallback
,
failureCallback
:
{
errorCode
in
}
)
func
getCampaignsCallback
(
_
campaignsData
:
Array
<
swiftApi
.
CampaignItemModel
>
?)
->
Void
{
if
(
campaignsData
!=
nil
)
{
...
...
@@ -197,8 +197,8 @@ var timer2: DispatchSourceTimer?
let
couponEvent
=
swiftApi
.
CouponEventModel
()
SwiftEventBus
.
post
(
"coupon_retrieved"
,
sender
:
couponEvent
)
swiftApi
()
.
getCouponsAsync
(
getCouponsCallback
)
swiftApi
()
.
getCampaignsAsyncNew
(
language
:
"en"
,
filters
:
[
String
:
Any
](),
getCampaignsCallback
)
swiftApi
()
.
getCouponsAsync
(
getCouponsCallback
,
failureCallback
:
{
errorCode
in
}
)
swiftApi
()
.
getCampaignsAsyncNew
(
language
:
"en"
,
filters
:
[
String
:
Any
](),
getCampaignsCallback
,
failureCallback
:
{
errorCode
in
}
)
func
getCouponsCallback
(
_
couponsData
:
Array
<
swiftApi
.
CouponItemModel
>
?)
->
Void
{
if
(
couponsData
!=
nil
)
{
...
...
SwiftWarplyFramework/SwiftWarplyFramework/ContextualViewController.swift
View file @
abce72d
...
...
@@ -158,7 +158,7 @@ import SwiftEventBus
// MARK: - API CALLS
func
getProfileRequest
()
{
swiftApi
()
.
getProfileAsync
(
getProfileCallback
)
swiftApi
()
.
getProfileAsync
(
getProfileCallback
,
failureCallback
:
{
errorCode
in
}
)
}
func
getProfileCallback
(
_
profileData
:
swiftApi
.
ProfileModel
?)
->
Void
{
...
...
@@ -173,7 +173,16 @@ import SwiftEventBus
func
submitOrderRequest
()
{
swiftApi
()
.
submitOrderAsync
(
campaign_session_uuid
:
""
,
user_msisdn
:
self
.
selectedNumber
,
businessService
:
(
ccms
?
.
_businessService
??
""
),
offerName
:
(
ccms
?
.
_offerName
??
""
),
productType
:
(
ccms
?
.
_productType
??
""
),
provDuration
:
(
ccms
?
.
_provDuration
??
""
),
noOfRecurrance
:
(
ccms
?
.
_noOfRecurrance
??
""
),
price
:
(
ccms
?
.
_price
??
""
),
discount
:
(
ccms
?
.
_discount
??
""
),
voiceCategory
:
(
ccms
?
.
_voiceCategory
??
""
),
dataCategory
:
(
ccms
?
.
_dataCategory
??
""
),
minsValue
:
(
ccms
?
.
_minsValue
??
""
),
dataValue
:
(
ccms
?
.
_dataValue
??
""
),
provStepValueMins
:
(
ccms
?
.
_provStepValueMins
??
""
),
OfferAudienceLevel
:
(
ccms
?
.
_offerAudienceLevel
??
""
),
UACIOfferTrackingCode
:
(
ccms
?
.
_uaciOfferTrackingCode
??
""
),
OFFERCODE1
:
(
ccms
?
.
_offerCode1
??
""
),
SCORE
:
(
ccms
?
.
_score
??
""
),
ZONE
:
(
ccms
?
.
_zone
??
""
),
WAVE
:
(
ccms
?
.
_wave
??
""
),
VALIDITY
:
(
ccms
?
.
_validity
??
""
),
TREATMENT_CODE
:
(
ccms
?
.
_treatmentCode
??
""
),
ccms_session_id
:
(
ccms
?
.
_sessionId
??
""
),
notificationMessage
:
(
ccms
?
.
_notificationMessage
??
""
),
submitOrderCallback
)
submitOrderCallback
,
failureCallback
:
{
errorCode
in
let
firebaseEvent
=
swiftApi
.
LoyaltySDKFirebaseEventModel
()
firebaseEvent
.
_eventName
=
"loyalty_offer_activated"
firebaseEvent
.
setParameter
=
(
"name"
,
(
self
.
ccms
?
.
_title
??
""
))
firebaseEvent
.
setParameter
=
(
"type"
,
"gift"
)
firebaseEvent
.
setParameter
=
(
"successful"
,
"false"
)
SwiftEventBus
.
post
(
"firebase"
,
sender
:
firebaseEvent
)
self
.
showDialog
(
"Αποτυχία"
,
"Κάτι πήγε στραβά"
)
})
}
func
submitOrderCallback
(
_
response
:
swiftApi
.
GenericResponseModel
?)
->
Void
{
...
...
SwiftWarplyFramework/SwiftWarplyFramework/CouponViewController.swift
View file @
abce72d
...
...
@@ -181,10 +181,32 @@ import SwiftEventBus
showSpinner
()
if
(
ccms
==
nil
)
{
swiftApi
()
.
redeemCouponSetAsync
(
uuid
:
uuid
,
communication_uuid
:
communication_uuid
,
redeemCouponSetCallback
)
swiftApi
()
.
redeemCouponSetAsync
(
uuid
:
uuid
,
communication_uuid
:
communication_uuid
,
redeemCouponSetCallback
,
failureCallback
:
{
errorCode
in
self
.
hideSpinner
()
let
firebaseEvent
=
swiftApi
.
LoyaltySDKFirebaseEventModel
()
firebaseEvent
.
_eventName
=
"loyalty_offer_activated"
firebaseEvent
.
setParameter
=
(
"name"
,
(
self
.
couponset
?
.
name
??
""
))
firebaseEvent
.
setParameter
=
(
"type"
,
"coupon"
)
firebaseEvent
.
setParameter
=
(
"successful"
,
"false"
)
SwiftEventBus
.
post
(
"firebase"
,
sender
:
firebaseEvent
)
self
.
showDialog
(
"Αποτυχία"
,
"Κάτι πήγε στραβά"
)
})
}
else
{
// TODO: MAybe change user_msisdn: profile?._msisdn ?? ""
swiftApi
()
.
redeemCouponSetAsync
(
uuid
:
uuid
,
communication_uuid
:
communication_uuid
,
user_msisdn
:
profile
?
.
_msisdn
??
""
,
businessService
:
(
ccms
?
.
_businessService
??
""
),
offerName
:
(
ccms
?
.
_offerName
??
""
),
productType
:
(
ccms
?
.
_productType
??
""
),
provDuration
:
(
ccms
?
.
_provDuration
??
""
),
noOfRecurrance
:
(
ccms
?
.
_noOfRecurrance
??
""
),
price
:
(
ccms
?
.
_price
??
""
),
discount
:
(
ccms
?
.
_discount
??
""
),
voiceCategory
:
(
ccms
?
.
_voiceCategory
??
""
),
dataCategory
:
(
ccms
?
.
_dataCategory
??
""
),
minsValue
:
(
ccms
?
.
_minsValue
??
""
),
dataValue
:
(
ccms
?
.
_dataValue
??
""
),
provStepValueMins
:
(
ccms
?
.
_provStepValueMins
??
""
),
OfferAudienceLevel
:
(
ccms
?
.
_offerAudienceLevel
??
""
),
UACIOfferTrackingCode
:
(
ccms
?
.
_uaciOfferTrackingCode
??
""
),
OFFERCODE1
:
(
ccms
?
.
_offerCode1
??
""
),
SCORE
:
(
ccms
?
.
_score
??
""
),
ZONE
:
(
ccms
?
.
_zone
??
""
),
WAVE
:
(
ccms
?
.
_wave
??
""
),
VALIDITY
:
(
ccms
?
.
_validity
??
""
),
TREATMENT_CODE
:
(
ccms
?
.
_treatmentCode
??
""
),
ccms_session_id
:
(
ccms
?
.
_sessionId
??
""
),
redeemCouponSetCallback
)
swiftApi
()
.
redeemCouponSetAsync
(
uuid
:
uuid
,
communication_uuid
:
communication_uuid
,
user_msisdn
:
profile
?
.
_msisdn
??
""
,
businessService
:
(
ccms
?
.
_businessService
??
""
),
offerName
:
(
ccms
?
.
_offerName
??
""
),
productType
:
(
ccms
?
.
_productType
??
""
),
provDuration
:
(
ccms
?
.
_provDuration
??
""
),
noOfRecurrance
:
(
ccms
?
.
_noOfRecurrance
??
""
),
price
:
(
ccms
?
.
_price
??
""
),
discount
:
(
ccms
?
.
_discount
??
""
),
voiceCategory
:
(
ccms
?
.
_voiceCategory
??
""
),
dataCategory
:
(
ccms
?
.
_dataCategory
??
""
),
minsValue
:
(
ccms
?
.
_minsValue
??
""
),
dataValue
:
(
ccms
?
.
_dataValue
??
""
),
provStepValueMins
:
(
ccms
?
.
_provStepValueMins
??
""
),
OfferAudienceLevel
:
(
ccms
?
.
_offerAudienceLevel
??
""
),
UACIOfferTrackingCode
:
(
ccms
?
.
_uaciOfferTrackingCode
??
""
),
OFFERCODE1
:
(
ccms
?
.
_offerCode1
??
""
),
SCORE
:
(
ccms
?
.
_score
??
""
),
ZONE
:
(
ccms
?
.
_zone
??
""
),
WAVE
:
(
ccms
?
.
_wave
??
""
),
VALIDITY
:
(
ccms
?
.
_validity
??
""
),
TREATMENT_CODE
:
(
ccms
?
.
_treatmentCode
??
""
),
ccms_session_id
:
(
ccms
?
.
_sessionId
??
""
),
redeemCouponSetCallback
,
failureCallback
:
{
errorCode
in
self
.
hideSpinner
()
let
firebaseEvent
=
swiftApi
.
LoyaltySDKFirebaseEventModel
()
firebaseEvent
.
_eventName
=
"loyalty_offer_activated"
firebaseEvent
.
setParameter
=
(
"name"
,
(
self
.
couponset
?
.
name
??
""
))
firebaseEvent
.
setParameter
=
(
"type"
,
"coupon"
)
firebaseEvent
.
setParameter
=
(
"successful"
,
"false"
)
SwiftEventBus
.
post
(
"firebase"
,
sender
:
firebaseEvent
)
self
.
showDialog
(
"Αποτυχία"
,
"Κάτι πήγε στραβά"
)
})
}
}
...
...
@@ -209,8 +231,8 @@ import SwiftEventBus
self
.
showSuccessDialog
(
"Επιτυχής ενεργοποίηση"
,
"Το κουπόνι σου έχει ενεργοποιηθεί στην ενότητα My Rewards."
)
swiftApi
()
.
getCouponsAsync
(
getCouponsCallback
)
swiftApi
()
.
getCampaignsAsyncNew
(
language
:
"en"
,
filters
:
[
String
:
Any
](),
getCampaignsCallback
)
swiftApi
()
.
getCouponsAsync
(
getCouponsCallback
,
failureCallback
:
{
errorCode
in
}
)
swiftApi
()
.
getCampaignsAsyncNew
(
language
:
"en"
,
filters
:
[
String
:
Any
](),
getCampaignsCallback
,
failureCallback
:
{
errorCode
in
}
)
func
getCouponsCallback
(
_
couponsData
:
Array
<
swiftApi
.
CouponItemModel
>
?)
->
Void
{
if
(
couponsData
!=
nil
)
{
...
...
SwiftWarplyFramework/SwiftWarplyFramework/CouponsViewController.swift
View file @
abce72d
...
...
@@ -49,7 +49,9 @@ import SwiftEventBus
// MARK: - API Functions
func
getCouponsRequest
()
{
swiftApi
()
.
getCouponsAsync
(
getCouponsCallback
)
swiftApi
()
.
getCouponsAsync
(
getCouponsCallback
,
failureCallback
:
{
errorCode
in
self
.
coupons
=
[]
})
}
func
getCouponsCallback
(
_
couponsData
:
Array
<
swiftApi
.
CouponItemModel
>
?)
->
Void
{
...
...
SwiftWarplyFramework/SwiftWarplyFramework/ShareViewController.swift
View file @
abce72d
...
...
@@ -254,7 +254,9 @@ import SwiftEventBus
// MARK: - API Calls
func
getProfileRequest
()
{
swiftApi
()
.
getProfileAsync
(
getProfileCallback
)
swiftApi
()
.
getProfileAsync
(
getProfileCallback
,
failureCallback
:
{
errorCode
in
print
(
"========= getProfileRequest ERROR ========="
)
})
}
func
getProfileCallback
(
_
profileData
:
swiftApi
.
ProfileModel
?)
->
Void
{
...
...
@@ -270,7 +272,9 @@ import SwiftEventBus
}
func
cosmoteCouponSharingRequest
()
{
swiftApi
()
.
cosmoteCouponSharingAsync
(
coupon
:
coupon
?
.
coupon
??
""
,
sender
:
selectedNumber
,
receiver
:
numberTextField
.
text
??
""
,
couponSharingCallback
)
swiftApi
()
.
cosmoteCouponSharingAsync
(
coupon
:
coupon
?
.
coupon
??
""
,
sender
:
selectedNumber
,
receiver
:
numberTextField
.
text
??
""
,
couponSharingCallback
,
failureCallback
:
{
errorCode
in
self
.
showDialog
(
"Αποτυχία"
,
"Κάτι πήγε στραβά"
)
})
}
func
couponSharingCallback
(
_
response
:
swiftApi
.
GenericResponseModel
?)
->
Void
{
...
...
@@ -278,7 +282,7 @@ import SwiftEventBus
DispatchQueue
.
main
.
async
{
if
(
response
?
.
getStatus
==
1
)
{
swiftApi
()
.
getCouponsAsync
(
getCouponsCallback
)
swiftApi
()
.
getCouponsAsync
(
getCouponsCallback
,
failureCallback
:
{
errorCode
in
}
)
func
getCouponsCallback
(
_
couponsData
:
Array
<
swiftApi
.
CouponItemModel
>
?)
->
Void
{
if
(
couponsData
!=
nil
)
{
...
...
SwiftWarplyFramework/SwiftWarplyFramework/SharingHistoryViewController.swift
View file @
abce72d
...
...
@@ -40,7 +40,7 @@ class SharingHistoryViewController: AnalysisChildViewController {
showLoading
()
swiftApi
()
.
getSharingHistoryAsync
(
responseCallback
)
swiftApi
()
.
getSharingHistoryAsync
(
responseCallback
,
failureCallback
:
{
errorCode
in
}
)
}
private
func
showLoading
()
{
...
...
SwiftWarplyFramework/SwiftWarplyFramework/TelcoViewController.swift
View file @
abce72d
...
...
@@ -212,7 +212,7 @@ import SwiftEventBus
// MARK: - API CALLS
func
getProfileRequest
()
{
swiftApi
()
.
getProfileAsync
(
getProfileCallback
)
swiftApi
()
.
getProfileAsync
(
getProfileCallback
,
failureCallback
:
{
errorCode
in
}
)
}
func
getProfileCallback
(
_
profileData
:
swiftApi
.
ProfileModel
?)
->
Void
{
...
...
@@ -227,7 +227,16 @@ import SwiftEventBus
func
submitOrderRequest
()
{
swiftApi
()
.
submitOrderAsync
(
campaign_session_uuid
:
(
campaign
?
.
session_uuid
??
""
),
user_msisdn
:
self
.
selectedNumber
,
businessService
:
(
ccms
?
.
_businessService
??
""
),
offerName
:
(
ccms
?
.
_offerName
??
""
),
productType
:
(
ccms
?
.
_productType
??
""
),
provDuration
:
(
ccms
?
.
_provDuration
??
""
),
noOfRecurrance
:
(
ccms
?
.
_noOfRecurrance
??
""
),
price
:
(
ccms
?
.
_price
??
""
),
discount
:
(
ccms
?
.
_discount
??
""
),
voiceCategory
:
(
ccms
?
.
_voiceCategory
??
""
),
dataCategory
:
(
ccms
?
.
_dataCategory
??
""
),
minsValue
:
(
ccms
?
.
_minsValue
??
""
),
dataValue
:
(
ccms
?
.
_dataValue
??
""
),
provStepValueMins
:
(
ccms
?
.
_provStepValueMins
??
""
),
OfferAudienceLevel
:
(
ccms
?
.
_offerAudienceLevel
??
""
),
UACIOfferTrackingCode
:
(
ccms
?
.
_uaciOfferTrackingCode
??
""
),
OFFERCODE1
:
(
ccms
?
.
_offerCode1
??
""
),
SCORE
:
(
ccms
?
.
_score
??
""
),
ZONE
:
(
ccms
?
.
_zone
??
""
),
WAVE
:
(
ccms
?
.
_wave
??
""
),
VALIDITY
:
(
ccms
?
.
_validity
??
""
),
TREATMENT_CODE
:
(
ccms
?
.
_treatmentCode
??
""
),
ccms_session_id
:
(
ccms
?
.
_sessionId
??
""
),
notificationMessage
:
(
ccms
?
.
_notificationMessage
??
""
),
submitOrderCallback
)
submitOrderCallback
,
failureCallback
:
{
errorCode
in
let
firebaseEvent
=
swiftApi
.
LoyaltySDKFirebaseEventModel
()
firebaseEvent
.
_eventName
=
"loyalty_offer_activated"
firebaseEvent
.
setParameter
=
(
"name"
,
(
self
.
ccms
?
.
_title
??
""
))
firebaseEvent
.
setParameter
=
(
"type"
,
"gift"
)
firebaseEvent
.
setParameter
=
(
"successful"
,
"false"
)
SwiftEventBus
.
post
(
"firebase"
,
sender
:
firebaseEvent
)
self
.
showDialog
(
"Αποτυχία"
,
"Κάτι πήγε στραβά"
)
})
}
func
submitOrderCallback
(
_
response
:
swiftApi
.
GenericResponseModel
?)
->
Void
{
...
...
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
View file @
abce72d
This diff is collapsed. Click to expand it.
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
abce72d
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment