Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_android_sdk_maven_plugin
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Panagiotis Triantafyllou
2022-07-08 16:15:40 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
de0fbcdeb4419e64786c8dfcbf718200878fae30
de0fbcde
1 parent
1227a057
new version
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
440 additions
and
26 deletions
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/Warply.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/WarpViewActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/LoyaltyContextualOfferModel.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/WarplyPacingEventModel.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyEventBusManager.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/WarpView.java
warply_android_sdk/build.gradle
View file @
de0fbcd
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4-cosbeta2
7a
'
PUBLISH_VERSION
=
'4.5.4-cosbeta2
8
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/Warply.java
View file @
de0fbcd
...
...
@@ -63,6 +63,7 @@ import ly.warp.sdk.io.callbacks.WarplyReadyCallback;
import
ly.warp.sdk.io.models.Campaign
;
import
ly.warp.sdk.io.models.CampaignList
;
import
ly.warp.sdk.io.models.InboxStats
;
import
ly.warp.sdk.io.models.LoyaltyContextualOfferModel
;
import
ly.warp.sdk.io.request.WarplyInboxRequest
;
import
ly.warp.sdk.io.request.WarplyJsonArrayRequest
;
import
ly.warp.sdk.io.request.WarplyJsonObjectRequest
;
...
...
@@ -477,6 +478,300 @@ public enum Warply {
@Override
public
void
onSuccess
(
CampaignList
result
)
{
WarplyManagerHelper
.
setCampaignList
(
result
);
ArrayList
<
LoyaltyContextualOfferModel
>
list
=
new
ArrayList
<>();
JSONArray
jArray
=
null
;
try
{
jArray
=
new
JSONArray
(
"[\n"
+
" {\n"
+
" \"UACIOfferTrackingCode\": \"5166.e07.fffffffffa10663a.ffffffffda30c76a\",\n"
+
" \"businessAdditionalId\": \"\",\n"
+
" \"dataCategory\": \"Data\",\n"
+
" \"dataValue\": \"None\",\n"
+
" \"discount\": \"None\",\n"
+
" \"eligibleAssets\": [\n"
+
" \"306945218770\"\n"
+
" ],\n"
+
" \"id\": \"000003590\",\n"
+
" \"loyaltyCampaignId\": \"NA\",\n"
+
" \"minsValue\": \"None\",\n"
+
" \"noOfRecurrance\": \"None\",\n"
+
" \"notificationMessage\": \"None\",\n"
+
" \"offerAudienceLevel\": \"msisdn\",\n"
+
" \"offerCode1\": \"000003590\",\n"
+
" \"offerName\": \"CCMS loyalty white label\",\n"
+
" \"price\": \"None\",\n"
+
" \"productType\": \"White Label\",\n"
+
" \"provDuration\": \"0.0\",\n"
+
" \"provStepValueMins\": \"None\",\n"
+
" \"score\": \"50\",\n"
+
" \"treatmentCode\": \"5166.e07.fffffffffa10663a.ffffffffda30c76a\",\n"
+
" \"validity\": \"0\",\n"
+
" \"voiceCategory\": \"None\",\n"
+
" \"wave\": \"1\",\n"
+
" \"zone\": \"COSMOTE_APP_LOYALTY_PROMO\"\n"
+
" },\n"
+
" {\n"
+
" \"UACIOfferTrackingCode\": \"51ed.e10.2c006f18.71e96d08\",\n"
+
" \"businessAdditionalId\": \"\",\n"
+
" \"dataCategory\": \"Data\",\n"
+
" \"dataValue\": \"None\",\n"
+
" \"discount\": \"None\",\n"
+
" \"eligibleAssets\": [\n"
+
" \"306945218770\"\n"
+
" ],\n"
+
" \"id\": \"000003599\",\n"
+
" \"loyaltyCampaignId\": \"c5cc5f4f65624f47a580b720233fa60d\",\n"
+
" \"minsValue\": \"None\",\n"
+
" \"noOfRecurrance\": \"None\",\n"
+
" \"notificationMessage\": \"None\",\n"
+
" \"offerAudienceLevel\": \"msisdn\",\n"
+
" \"offerCode1\": \"000003599\",\n"
+
" \"offerName\": \"CCMS loyalty white label with campaignId\",\n"
+
" \"price\": \"None\",\n"
+
" \"productType\": \"White Label\",\n"
+
" \"provDuration\": \"0.0\",\n"
+
" \"provStepValueMins\": \"None\",\n"
+
" \"score\": \"50\",\n"
+
" \"treatmentCode\": \"51ed.e10.2c006f18.71e96d08\",\n"
+
" \"validity\": \"0\",\n"
+
" \"voiceCategory\": \"None\",\n"
+
" \"wave\": \"1\",\n"
+
" \"zone\": \"COSMOTE_APP_LOYALTY_PROMO\"\n"
+
" },\n"
+
" {\n"
+
" \"UACIOfferTrackingCode\": \"516c.e05.ffffffffa943695b.79ff470b\",\n"
+
" \"businessAdditionalId\": \"\",\n"
+
" \"businessService\": \"0.0\",\n"
+
" \"eligibleAssets\": [\n"
+
" \"306945218770\"\n"
+
" ],\n"
+
" \"id\": \"000003588\",\n"
+
" \"loyaltyCampaignId\": \"NA\",\n"
+
" \"noOfRecurrance\": \"0\",\n"
+
" \"notificationMessage\": \"None\",\n"
+
" \"offerAudienceLevel\": \"msisdn\",\n"
+
" \"offerCode1\": \"000003588\",\n"
+
" \"offerName\": \"CCMS loyalty postpay addon\",\n"
+
" \"postpayProduct\": \"0.0\",\n"
+
" \"price\": \"None\",\n"
+
" \"productType\": \"MOBILE ADDON\",\n"
+
" \"provDuration\": \"0.0\",\n"
+
" \"score\": \"50\",\n"
+
" \"treatmentCode\": \"516c.e05.ffffffffa943695b.79ff470b\",\n"
+
" \"validity\": \"0\",\n"
+
" \"wave\": \"1\",\n"
+
" \"zone\": \"COSMOTE_APP_LOYALTY_PROMO\"\n"
+
" },\n"
+
" {\n"
+
" \"UACIOfferTrackingCode\": \"5224.e19.30e2f27b.ffffffffeb22b0db\",\n"
+
" \"businessAdditionalId\": \"\",\n"
+
" \"dataCategory\": \"Data\",\n"
+
" \"dataValue\": \"None\",\n"
+
" \"discount\": \"None\",\n"
+
" \"eligibleAssets\": [\n"
+
" \"306945218770\"\n"
+
" ],\n"
+
" \"id\": \"000003608\",\n"
+
" \"loyaltyCampaignId\": \"c134cdeb8a924f8eac38e261acb9caf5\",\n"
+
" \"minsValue\": \"None\",\n"
+
" \"noOfRecurrance\": \"None\",\n"
+
" \"notificationMessage\": \"None\",\n"
+
" \"offerAudienceLevel\": \"msisdn\",\n"
+
" \"offerCode1\": \"000003608\",\n"
+
" \"offerName\": \"CCMS loyalty gifts4u v1\",\n"
+
" \"price\": \"None\",\n"
+
" \"productType\": \"White Label\",\n"
+
" \"provDuration\": \"0.0\",\n"
+
" \"provStepValueMins\": \"None\",\n"
+
" \"score\": \"50\",\n"
+
" \"treatmentCode\": \"5224.e19.30e2f27b.ffffffffeb22b0db\",\n"
+
" \"validity\": \"0\",\n"
+
" \"voiceCategory\": \"None\",\n"
+
" \"wave\": \"1\",\n"
+
" \"zone\": \"COSMOTE_APP_GIFTS4U\"\n"
+
" },\n"
+
" {\n"
+
" \"UACIOfferTrackingCode\": \"5228.e1d.38378e61.750186c1\",\n"
+
" \"businessAdditionalId\": \"\",\n"
+
" \"businessService\": \"0.0\",\n"
+
" \"eligibleAssets\": [\n"
+
" \"306945218770\"\n"
+
" ],\n"
+
" \"id\": \"000003612\",\n"
+
" \"loyaltyCampaignId\": \"8eb71c4ceaff409c896e2d1f6f1c20f3\",\n"
+
" \"noOfRecurrance\": \"0\",\n"
+
" \"notificationMessage\": \"None\",\n"
+
" \"offerAudienceLevel\": \"msisdn\",\n"
+
" \"offerCode1\": \"000003612\",\n"
+
" \"offerName\": \"CCMS loyalty - postpay addon gifts4u\",\n"
+
" \"postpayProduct\": \"0.0\",\n"
+
" \"price\": \"None\",\n"
+
" \"productType\": \"MOBILE ADDON\",\n"
+
" \"provDuration\": \"0.0\",\n"
+
" \"score\": \"50\",\n"
+
" \"treatmentCode\": \"5228.e1d.38378e61.750186c1\",\n"
+
" \"validity\": \"0\",\n"
+
" \"wave\": \"1\",\n"
+
" \"zone\": \"COSMOTE_APP_GIFTS4U\"\n"
+
" },\n"
+
" {\n"
+
" \"UACIOfferTrackingCode\": \"5222.e1b.ffffffffe725d1b3.ffffffffed6d8723\",\n"
+
" \"businessAdditionalId\": \"\",\n"
+
" \"dataCategory\": \"Data\",\n"
+
" \"dataValue\": \"None\",\n"
+
" \"discount\": \"None\",\n"
+
" \"eligibleAssets\": [\n"
+
" \"306945218770\"\n"
+
" ],\n"
+
" \"id\": \"000003610\",\n"
+
" \"loyaltyCampaignId\": \"8e2c88ec94c948d8b51577324ed9a4d5\",\n"
+
" \"minsValue\": \"None\",\n"
+
" \"noOfRecurrance\": \"None\",\n"
+
" \"notificationMessage\": \"None\",\n"
+
" \"offerAudienceLevel\": \"msisdn\",\n"
+
" \"offerCode1\": \"000003610\",\n"
+
" \"offerName\": \"CCMS loyalty more4u v1\",\n"
+
" \"price\": \"20\",\n"
+
" \"productType\": \"White Label\",\n"
+
" \"provDuration\": \"7.0\",\n"
+
" \"provStepValueMins\": \"None\",\n"
+
" \"score\": \"60\",\n"
+
" \"treatmentCode\": \"5222.e1b.ffffffffe725d1b3.ffffffffed6d8723\",\n"
+
" \"validity\": \"0\",\n"
+
" \"voiceCategory\": \"None\",\n"
+
" \"wave\": \"1\",\n"
+
" \"zone\": \"COSMOTE_APP_MORE4U\"\n"
+
" },\n"
+
" {\n"
+
" \"UACIOfferTrackingCode\": \"5226.e1f.728b68c6.ffffffffa6c7b10e\",\n"
+
" \"businessAdditionalId\": \"\",\n"
+
" \"businessService\": \"0.0\",\n"
+
" \"eligibleAssets\": [\n"
+
" \"306945218770\"\n"
+
" ],\n"
+
" \"id\": \"000003614\",\n"
+
" \"loyaltyCampaignId\": \"aaf4022194584f02bb84c7b283c7c51e\",\n"
+
" \"noOfRecurrance\": \"0\",\n"
+
" \"notificationMessage\": \"None\",\n"
+
" \"offerAudienceLevel\": \"msisdn\",\n"
+
" \"offerCode1\": \"000003614\",\n"
+
" \"offerName\": \"CCMS loyalty - postpay addon more4u\",\n"
+
" \"postpayProduct\": \"0.0\",\n"
+
" \"price\": \"None\",\n"
+
" \"productType\": \"MOBILE ADDON\",\n"
+
" \"provDuration\": \"0.0\",\n"
+
" \"score\": \"50\",\n"
+
" \"treatmentCode\": \"5226.e1f.728b68c6.ffffffffa6c7b10e\",\n"
+
" \"validity\": \"0\",\n"
+
" \"wave\": \"1\",\n"
+
" \"zone\": \"COSMOTE_APP_MORE4U\"\n"
+
" },\n"
+
" {\n"
+
" \"UACIOfferTrackingCode\": \"5154.e03.ffffffffeebc476a.ffffffffc5b96f6a\",\n"
+
" \"businessAdditionalId\": \"\",\n"
+
" \"eligibleAssets\": [],\n"
+
" \"id\": \"000003586\",\n"
+
" \"loyaltyCampaignId\": \"NA\",\n"
+
" \"offerAudienceLevel\": \"guid\",\n"
+
" \"offerCode1\": \"000003586\",\n"
+
" \"offerName\": \"CCMS loyalty offer 6\",\n"
+
" \"productType\": \"GENERIC\",\n"
+
" \"score\": \"50\",\n"
+
" \"treatmentCode\": \"5154.e03.ffffffffeebc476a.ffffffffc5b96f6a\",\n"
+
" \"validity\": \"0\",\n"
+
" \"zone\": \"COSMOTE_APP_LOYALTY_PROMO\"\n"
+
" },\n"
+
" {\n"
+
" \"UACIOfferTrackingCode\": \"51d2.e0c.291f49d9.40d5a689\",\n"
+
" \"businessAdditionalId\": \"\",\n"
+
" \"eligibleAssets\": [],\n"
+
" \"id\": \"000003595\",\n"
+
" \"loyaltyCampaignId\": \"c5cc5f4f65624f47a580b720233fa60d\",\n"
+
" \"offerAudienceLevel\": \"guid\",\n"
+
" \"offerCode1\": \"000003595\",\n"
+
" \"offerName\": \"CCMS Loyal offer campaignId\",\n"
+
" \"productType\": \"GENERIC\",\n"
+
" \"score\": \"50\",\n"
+
" \"treatmentCode\": \"51d2.e0c.291f49d9.40d5a689\",\n"
+
" \"validity\": \"0\",\n"
+
" \"zone\": \"COSMOTE_APP_LOYALTY_PROMO\"\n"
+
" },\n"
+
" {\n"
+
" \"UACIOfferTrackingCode\": \"51d6.e0c.291f49d9.40d5a689\",\n"
+
" \"businessAdditionalId\": \"\",\n"
+
" \"eligibleAssets\": [],\n"
+
" \"id\": \"000003595\",\n"
+
" \"loyaltyCampaignId\": \"c5cc5f4f65624f47a580b720233fa60d\",\n"
+
" \"offerAudienceLevel\": \"guid\",\n"
+
" \"offerCode1\": \"000003595\",\n"
+
" \"offerName\": \"CCMS Loyal offer campaignId\",\n"
+
" \"productType\": \"GENERIC\",\n"
+
" \"score\": \"50\",\n"
+
" \"treatmentCode\": \"51d6.e0c.291f49d9.40d5a689\",\n"
+
" \"validity\": \"0\",\n"
+
" \"zone\": \"COSMOTE_APP_GIFTS4U\"\n"
+
" },\n"
+
" {\n"
+
" \"UACIOfferTrackingCode\": \"5150.e03.ffffffffeebc476a.ffffffffc5b96f6a\",\n"
+
" \"businessAdditionalId\": \"\",\n"
+
" \"eligibleAssets\": [],\n"
+
" \"id\": \"000003586\",\n"
+
" \"loyaltyCampaignId\": \"NA\",\n"
+
" \"offerAudienceLevel\": \"guid\",\n"
+
" \"offerCode1\": \"000003586\",\n"
+
" \"offerName\": \"CCMS loyalty offer 6\",\n"
+
" \"productType\": \"GENERIC\",\n"
+
" \"score\": \"50\",\n"
+
" \"treatmentCode\": \"5150.e03.ffffffffeebc476a.ffffffffc5b96f6a\",\n"
+
" \"validity\": \"0\",\n"
+
" \"zone\": \"COSMOTE_APP_GIFTS4U\"\n"
+
" },\n"
+
" {\n"
+
" \"UACIOfferTrackingCode\": \"5152.e03.ffffffffeebc476a.ffffffffc5b96f6a\",\n"
+
" \"businessAdditionalId\": \"\",\n"
+
" \"eligibleAssets\": [],\n"
+
" \"id\": \"000003586\",\n"
+
" \"loyaltyCampaignId\": \"NA\",\n"
+
" \"offerAudienceLevel\": \"guid\",\n"
+
" \"offerCode1\": \"000003586\",\n"
+
" \"offerName\": \"CCMS loyalty offer 6\",\n"
+
" \"productType\": \"GENERIC\",\n"
+
" \"score\": \"50\",\n"
+
" \"treatmentCode\": \"5152.e03.ffffffffeebc476a.ffffffffc5b96f6a\",\n"
+
" \"validity\": \"0\",\n"
+
" \"zone\": \"COSMOTE_APP_MORE4U\"\n"
+
" },\n"
+
" {\n"
+
" \"UACIOfferTrackingCode\": \"51d4.e0c.291f49d9.40d5a689\",\n"
+
" \"businessAdditionalId\": \"\",\n"
+
" \"eligibleAssets\": [],\n"
+
" \"id\": \"000003595\",\n"
+
" \"loyaltyCampaignId\": \"c5cc5f4f65624f47a580b720233fa60d\",\n"
+
" \"offerAudienceLevel\": \"guid\",\n"
+
" \"offerCode1\": \"000003595\",\n"
+
" \"offerName\": \"CCMS Loyal offer campaignId\",\n"
+
" \"productType\": \"GENERIC\",\n"
+
" \"score\": \"50\",\n"
+
" \"treatmentCode\": \"51d4.e0c.291f49d9.40d5a689\",\n"
+
" \"validity\": \"0\",\n"
+
" \"zone\": \"COSMOTE_APP_MORE4U\"\n"
+
" }\n"
+
" ]"
);
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
}
if
(
jArray
!=
null
&&
jArray
.
length
()
>
0
)
{
for
(
int
i
=
0
;
i
<
jArray
.
length
();
i
++)
{
JSONObject
jobj
=
new
JSONObject
();
jobj
=
jArray
.
optJSONObject
(
i
);
if
(
jobj
!=
null
)
{
LoyaltyContextualOfferModel
model
=
new
LoyaltyContextualOfferModel
(
jobj
);
list
.
add
(
model
);
}
}
}
WarplyManagerHelper
.
setCCMSLoyaltyCampaigns
(
list
);
if
(
result
.
size
()
>=
0
)
{
objectSerializer
.
serialize
(
result
,
File
.
separator
+
requestSignature
);
warplyPreferences
.
saveInboxLastCachedTimeStamp
(
requestSignature
,
System
.
currentTimeMillis
());
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/WarpViewActivity.java
View file @
de0fbcd
...
...
@@ -129,9 +129,11 @@ public class WarpViewActivity extends WarpBaseActivity {
}
if
(
event
.
getCoupon
()
!=
null
)
finish
();
if
(
event
.
getPacingCard
()
!=
null
)
finish
();
if
(
event
.
getPacingService
()
!=
null
)
// if (event.getPacingCard() != null)
// finish();
// if (event.getPacingService() != null)
// finish();
if
(
event
.
getPacing
()
!=
null
)
finish
();
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/LoyaltyContextualOfferModel.java
View file @
de0fbcd
package
ly
.
warp
.
sdk
.
io
.
models
;
import
org.json.JSONArray
;
import
org.json.JSONObject
;
import
java.util.ArrayList
;
/**
...
...
@@ -7,8 +10,8 @@ import java.util.ArrayList;
*/
public
class
LoyaltyContextualOfferModel
{
private
String
sessionId
;
//Needed for Interest/Accept/Reject
private
ArrayList
<
String
>
eligibleAssets
;
//Array of the eligible assets for this offer
private
String
sessionId
;
private
ArrayList
<
String
>
eligibleAssets
;
private
String
id
;
private
String
businessAdditionalId
;
private
String
treatmentCode
;
...
...
@@ -66,6 +69,47 @@ public class LoyaltyContextualOfferModel {
this
.
offerAudienceLevel
=
""
;
}
public
LoyaltyContextualOfferModel
(
JSONObject
jobj
)
{
if
(
jobj
!=
null
)
{
this
.
sessionId
=
jobj
.
optString
(
"sessionId"
);
this
.
eligibleAssets
=
new
ArrayList
<>();
JSONArray
assets
=
new
JSONArray
();
assets
=
jobj
.
optJSONArray
(
"eligibleAssets"
);
if
(
assets
!=
null
&&
assets
.
length
()
>
0
)
{
ArrayList
<
String
>
assetsList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
assets
.
length
();
i
++)
{
assetsList
.
add
(
assets
.
optString
(
i
));
}
this
.
eligibleAssets
.
addAll
(
assetsList
);
}
this
.
id
=
jobj
.
optString
(
"id"
);
this
.
businessAdditionalId
=
jobj
.
optString
(
"businessAdditionalId"
);
this
.
treatmentCode
=
jobj
.
optString
(
"treatmentCode"
);
this
.
offerName
=
jobj
.
optString
(
"offerName"
);
this
.
productType
=
jobj
.
optString
(
"productType"
);
this
.
provDuration
=
jobj
.
optString
(
"provDuration"
);
this
.
noOfRecurrance
=
jobj
.
optString
(
"noOfRecurrance"
);
this
.
price
=
jobj
.
optString
(
"price"
);
this
.
discount
=
jobj
.
optString
(
"discount"
);
this
.
voiceCategory
=
jobj
.
optString
(
"voiceCategory"
);
this
.
dataCategory
=
jobj
.
optString
(
"dataCategory"
);
this
.
minsValue
=
jobj
.
optString
(
"minsValue"
);
this
.
dataValue
=
jobj
.
optString
(
"dataValue"
);
this
.
provStepValueMins
=
jobj
.
optString
(
"provStepValueMins"
);
this
.
postpayProduct
=
jobj
.
optString
(
"postpayProduct"
);
this
.
notificationMessage
=
jobj
.
optString
(
"notificationMessage"
);
this
.
loyaltyCampaignId
=
jobj
.
optString
(
"loyaltyCampaignId"
);
this
.
businessService
=
jobj
.
optString
(
"businessService"
);
this
.
UACIOfferTrackingCode
=
jobj
.
optString
(
"UACIOfferTrackingCode"
);
this
.
offerCode1
=
jobj
.
optString
(
"offerCode1"
);
this
.
score
=
jobj
.
optString
(
"score"
);
this
.
zone
=
jobj
.
optString
(
"zone"
);
this
.
wave
=
jobj
.
optString
(
"wave"
);
this
.
validity
=
jobj
.
optString
(
"validity"
);
this
.
offerAudienceLevel
=
jobj
.
optString
(
"offerAudienceLevel"
);
}
}
public
String
getSessionId
()
{
return
sessionId
;
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/WarplyPacingEventModel.java
0 → 100644
View file @
de0fbcd
/*
* Copyright 2010-2013 Warply Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package
ly
.
warp
.
sdk
.
io
.
models
;
/**
* Created by Panagiotis Triantafyllou on 08-July-22.
*/
public
class
WarplyPacingEventModel
{
private
boolean
isVisible
=
false
;
private
boolean
isEnabled
=
false
;
public
WarplyPacingEventModel
()
{
this
.
isVisible
=
false
;
this
.
isEnabled
=
false
;
}
public
boolean
isVisible
()
{
return
isVisible
;
}
public
void
setVisible
(
boolean
visible
)
{
isVisible
=
visible
;
}
public
boolean
isEnabled
()
{
return
isEnabled
;
}
public
void
setEnabled
(
boolean
enabled
)
{
isEnabled
=
enabled
;
}
}
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
View file @
de0fbcd
...
...
@@ -38,6 +38,7 @@ import java.util.HashMap;
import
ly.warp.sdk.R
;
import
ly.warp.sdk.Warply
;
import
ly.warp.sdk.activities.WarpViewActivity
;
import
ly.warp.sdk.db.WarplyDBHelper
;
import
ly.warp.sdk.io.callbacks.CallbackReceiver
;
import
ly.warp.sdk.io.models.ActiveDFYCouponModel
;
...
...
@@ -313,7 +314,8 @@ public class WarplyManagerHelper {
+
"&VALIDITY="
+
ccmsItem
.
getValidity
()
+
"&TREATMENT_CODE="
+
ccmsItem
.
getTreatmentCode
()
+
"&OfferAudienceLevel="
+
tempAudienceLevel
+
"&ASSETS="
+
assets
;
+
"&ASSETS="
+
assets
+
"&ZONE="
+
ccmsItem
.
getZone
();
// if (mConsumer != null)
...
...
@@ -330,15 +332,13 @@ public class WarplyManagerHelper {
public
static
String
constructCcmsUrl
(
LoyaltyContextualOfferModel
item
)
{
String
url
=
""
;
if
(
item
!=
null
)
{
if
(
m
UniqueCampaignList
!=
null
&&
mUniqueCampaignList
.
get
(
"gifts_for_you"
)
!=
null
&&
mUniqueCampaignList
.
get
(
"gifts_for_you"
)
.
size
()
>
0
)
{
for
(
Campaign
camp
:
m
UniqueCampaignList
.
get
(
"gifts_for_you"
)
)
{
if
(
m
CampaignList
!=
null
&&
mCampaignList
.
size
()
>
0
)
{
for
(
Campaign
camp
:
m
CampaignList
)
{
try
{
String
key
=
WarpJSONParser
.
getJSONFromString
(
camp
.
getExtraFields
()).
keys
().
next
();
if
(!
TextUtils
.
isEmpty
(
key
)
&&
key
.
equals
(
"ccms_offer"
))
{
String
keyValue
=
WarpJSONParser
.
getJSONFromString
(
camp
.
getExtraFields
()).
optString
(
key
);
if
(!
TextUtils
.
isEmpty
(
keyValue
)
&&
keyValue
.
equals
(
"true"
))
{
if
(
camp
.
getSessionUUID
().
equals
(
item
.
getLoyaltyCampaignId
()))
{
Log
.
v
(
"CCMS_PRESSED"
,
item
.
getId
()
+
" "
+
item
.
getOfferName
());
JSONObject
extraFields
=
WarpJSONParser
.
getJSONFromString
(
camp
.
getExtraFields
());
if
(
extraFields
!=
null
)
{
if
(
extraFields
.
has
(
"ccms_offer"
)
&&
extraFields
.
optString
(
"ccms_offer"
).
equals
(
"true"
))
{
if
(
item
.
getLoyaltyCampaignId
().
equals
(
camp
.
getSessionUUID
()))
{
String
tempAudienceLevel
=
item
.
getEligibleAssets
()
!=
null
&&
item
.
getEligibleAssets
().
size
()
>
0
?
"MSISDN"
:
"GUID"
;
String
assets
=
""
;
if
(
item
.
getEligibleAssets
()
!=
null
&&
item
.
getEligibleAssets
().
size
()
>
0
)
{
...
...
@@ -350,6 +350,7 @@ public class WarplyManagerHelper {
assets
=
assets
.
substring
(
0
,
assets
.
length
()
-
1
);
}
}
url
=
camp
.
getIndexUrl
()
+
"?web_id="
+
WarpUtils
.
getWebId
(
Warply
.
getWarplyContext
())
+
"&app_uuid="
+
WarplyProperty
.
getAppUuid
(
Warply
.
getWarplyContext
())
...
...
@@ -379,7 +380,8 @@ public class WarplyManagerHelper {
+
"&VALIDITY="
+
item
.
getValidity
()
+
"&TREATMENT_CODE="
+
item
.
getTreatmentCode
()
+
"&OfferAudienceLevel="
+
tempAudienceLevel
+
"&ASSETS="
+
assets
;
+
"&ASSETS="
+
assets
+
"&ZONE="
+
item
.
getZone
();
break
;
}
}
...
...
@@ -649,7 +651,8 @@ public class WarplyManagerHelper {
badge
.
setCouponCount
(
couponCount
);
badge
.
setValue
(
couponValue
);
mLoyaltyBadge
=
badge
;
mCouponList
=
cpnlist
;
mCouponList
.
clear
();
mCouponList
.
addAll
(
cpnlist
);
}
public
static
LoyaltyBadgeModel
getLoyaltyBadge
()
{
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyEventBusManager.java
View file @
de0fbcd
...
...
@@ -12,6 +12,7 @@ import ly.warp.sdk.io.models.WarplyCCMSEnabledModel;
import
ly.warp.sdk.io.models.WarplyDealsAnalysisEventModel
;
import
ly.warp.sdk.io.models.WarplyPacingCardEventModel
;
import
ly.warp.sdk.io.models.WarplyPacingCardServiceEnabledModel
;
import
ly.warp.sdk.io.models.WarplyPacingEventModel
;
/**
* Created by Panagiotis Triantafyllou on 26/Απρ/2022.
...
...
@@ -21,6 +22,7 @@ public class WarplyEventBusManager {
private
LoyaltySDKFirebaseEventModel
fireEvent
;
private
LoyaltyContextualOfferModel
ccms
;
protected
HashMap
<
String
,
Object
>
mWarplyEventBusManager
=
new
HashMap
();
private
WarplyPacingEventModel
pacing
;
private
WarplyPacingCardEventModel
pacingCard
;
private
WarplyPacingCardServiceEnabledModel
pacingService
;
private
WarplyDealsAnalysisEventModel
dealsAnalysis
;
...
...
@@ -54,13 +56,17 @@ public class WarplyEventBusManager {
this
.
fireEvent
=
fireEvent
;
}
public
WarplyEventBusManager
(
WarplyPacing
CardEventModel
pacingCard
)
{
this
.
pacing
Card
=
pacingCard
;
public
WarplyEventBusManager
(
WarplyPacing
EventModel
pacing
)
{
this
.
pacing
=
pacing
;
}
public
WarplyEventBusManager
(
WarplyPacingCardServiceEnabledModel
pacingService
)
{
this
.
pacingService
=
pacingService
;
}
// public WarplyEventBusManager(WarplyPacingCardEventModel pacingCard) {
// this.pacingCard = pacingCard;
// }
//
// public WarplyEventBusManager(WarplyPacingCardServiceEnabledModel pacingService) {
// this.pacingService = pacingService;
// }
public
WarplyEventBusManager
(
WarplyDealsAnalysisEventModel
dealsAnalysis
)
{
this
.
dealsAnalysis
=
dealsAnalysis
;
...
...
@@ -147,4 +153,8 @@ public class WarplyEventBusManager {
public
ActiveDFYCouponEventModel
getActiveCoupon
()
{
return
activeCoupon
;
}
public
WarplyPacingEventModel
getPacing
()
{
return
pacing
;
}
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/WarpView.java
View file @
de0fbcd
...
...
@@ -67,6 +67,7 @@ import ly.warp.sdk.io.models.CouponEventModel;
import
ly.warp.sdk.io.models.QuestionnaireEventModel
;
import
ly.warp.sdk.io.models.WarplyPacingCardEventModel
;
import
ly.warp.sdk.io.models.WarplyPacingCardServiceEnabledModel
;
import
ly.warp.sdk.io.models.WarplyPacingEventModel
;
import
ly.warp.sdk.services.UpdateUserLocationService
;
import
ly.warp.sdk.utils.WarpUtils
;
import
ly.warp.sdk.utils.WarplyProperty
;
...
...
@@ -398,19 +399,20 @@ public class WarpView extends WebView {
// EventBus.getDefault().post(new WarplyEventBusManager(new CouponEventModel()));
}
else
if
(
parts
[
2
].
equals
(
"serviceDisabled"
))
{
// WorkManager.getInstance(Warply.getWarplyContext()).cancelAllWorkByTag(UpdateUserLocationService.TAG);
WarplyPacing
CardServiceEnabledModel
pacingService
=
new
WarplyPacingCardServiceEnabled
Model
();
WarplyPacing
EventModel
pacingService
=
new
WarplyPacingEvent
Model
();
pacingService
.
setEnabled
(
false
);
pacingService
.
setVisible
(
false
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
pacingService
));
}
else
if
(
parts
[
2
].
equals
(
"serviceEnabled"
))
{
WarplyPacing
CardServiceEnabledModel
pacingService
=
new
WarplyPacingCardServiceEnabled
Model
();
WarplyPacing
EventModel
pacingService
=
new
WarplyPacingEvent
Model
();
pacingService
.
setEnabled
(
true
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
pacingService
));
}
else
if
(
parts
[
2
].
equals
(
"shortcutEnabled"
))
{
WarplyPacing
CardEventModel
pacingVisible
=
new
WarplyPacingCard
EventModel
();
WarplyPacing
EventModel
pacingVisible
=
new
WarplyPacing
EventModel
();
pacingVisible
.
setVisible
(
true
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
pacingVisible
));
}
else
if
(
parts
[
2
].
equals
(
"shortcutDisabled"
))
{
WarplyPacing
CardEventModel
pacingVisible
=
new
WarplyPacingCard
EventModel
();
WarplyPacing
EventModel
pacingVisible
=
new
WarplyPacing
EventModel
();
pacingVisible
.
setVisible
(
false
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
pacingVisible
));
}
else
if
(
parts
[
1
].
equals
(
"request"
)
||
parts
[
1
].
equals
(
"response"
))
{
...
...
Please
register
or
login
to post a comment