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-12 17:17:18 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b4fd35219c00d757840a6865fc211a9aaf203526
b4fd3521
1 parent
27c4688d
fixes
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
432 additions
and
382 deletions
app/src/main/java/warp/ly/android_sdk/activities/SplashActivity.java
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/BaseFragmentActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/GiftsForYouActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyWallet.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/MoreForYouActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/WarpViewActivity.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/WarplyManager.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/WarpView.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/ActiveCouponAdapter.java
app/src/main/java/warp/ly/android_sdk/activities/SplashActivity.java
View file @
b4fd352
...
...
@@ -42,7 +42,7 @@ public class SplashActivity extends BaseActivity {
// );
WarplyManager
.
getCosmoteUser
(
new
WarplyCosmoteUserRequest
()
.
setGuid
(
"601204932
1
"
),
.
setGuid
(
"601204932
2
"
),
mLoginReceiver
);
// WarplyManager.verifyTicket(new WarplyVerifyTicketRequest()
...
...
warply_android_sdk/build.gradle
View file @
b4fd352
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4-cosbeta
29
'
PUBLISH_VERSION
=
'4.5.4-cosbeta
30i
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/Warply.java
View file @
b4fd352
...
...
@@ -479,299 +479,299 @@ public enum Warply {
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);
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/BaseFragmentActivity.java
View file @
b4fd352
...
...
@@ -67,7 +67,8 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
new
Thread
(()
->
{
if
(!
Thread
.
currentThread
().
isInterrupted
())
{
WarplyManager
.
getConsumer
(
new
WarplyConsumerRequest
(),
mConsumerReceiver
);
// WarplyManager.getConsumer(new WarplyConsumerRequest(), mConsumerReceiver);
Warply
.
getInbox
(
new
WarplyInboxRequest
().
setUseCache
(
false
),
mInboxReceiver
);
}
}).
start
();
}
...
...
@@ -161,20 +162,20 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
// Inner and Anonymous Classes
// ===========================================================
private
final
CallbackReceiver
<
Consumer
>
mConsumerReceiver
=
new
CallbackReceiver
<
Consumer
>()
{
@Override
public
void
onSuccess
(
Consumer
result
)
{
mConsumer
=
result
;
WarplyManagerHelper
.
setConsumer
(
result
);
// private final CallbackReceiver<Consumer> mConsumerReceiver = new CallbackReceiver<Consumer>() {
// @Override
// public void onSuccess(Consumer result) {
// mConsumer = result;
//// WarplyManagerHelper.setConsumer(result);
//// Thread.currentThread().interrupt();
// Warply.getInbox(new WarplyInboxRequest().setUseCache(false), mInboxReceiver);
// }
//
// @Override
// public void onFailure(int errorCode) {
// Thread.currentThread().interrupt();
Warply
.
getInbox
(
new
WarplyInboxRequest
().
setUseCache
(
false
),
mInboxReceiver
);
}
@Override
public
void
onFailure
(
int
errorCode
)
{
Thread
.
currentThread
().
interrupt
();
}
};
// }
// };
private
final
CallbackReceiver
<
CampaignList
>
mInboxReceiver
=
new
CallbackReceiver
<
CampaignList
>()
{
@Override
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/GiftsForYouActivity.java
View file @
b4fd352
...
...
@@ -215,11 +215,11 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
private
void
filterItems
()
{
ArrayList
<
Campaign
>
gfyList
=
new
ArrayList
<>();
if
(
WarplyManagerHelper
.
getCampaignList
()
!=
null
&&
WarplyManagerHelper
.
getCampaignList
().
size
()
>
0
)
{
Log
.
v
(
"Got L:{"
+
String
.
valueOf
(
WarplyManagerHelper
.
getCampaignList
().
size
())
+
"}"
,
" LOYALTY campaigns"
);
if
(
WarplyManagerHelper
.
getCampaignList
All
()
!=
null
&&
WarplyManagerHelper
.
getCampaignListAll
().
size
()
>
0
)
{
Log
.
v
(
"Got L:{"
+
String
.
valueOf
(
WarplyManagerHelper
.
getCampaignList
All
().
size
())
+
"}"
,
" LOYALTY campaigns"
);
if
(
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
()
==
null
||
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
().
size
()
==
0
)
{
Log
.
v
(
"Got C:{0}"
,
" CCMS campaigns"
);
for
(
Campaign
camp
:
WarplyManagerHelper
.
getCampaignList
())
{
for
(
Campaign
camp
:
WarplyManagerHelper
.
getCampaignList
All
())
{
if
(
camp
.
getOfferCategory
().
equals
(
"gifts_for_you"
))
{
try
{
JSONObject
extraFields
=
WarpJSONParser
.
getJSONFromString
(
camp
.
getExtraFields
());
...
...
@@ -236,7 +236,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
}
else
{
int
ccmsCount
=
0
;
Log
.
v
(
"Got C:{"
+
String
.
valueOf
(
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
().
size
())
+
"}"
,
" CCMS campaigns"
);
for
(
Campaign
camp
:
WarplyManagerHelper
.
getCampaignList
())
{
for
(
Campaign
camp
:
WarplyManagerHelper
.
getCampaignList
All
())
{
if
(
camp
.
getOfferCategory
().
equals
(
"gifts_for_you"
))
{
try
{
JSONObject
extraFields
=
WarpJSONParser
.
getJSONFromString
(
camp
.
getExtraFields
());
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyWallet.java
View file @
b4fd352
...
...
@@ -19,21 +19,14 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy;
import
org.greenrobot.eventbus.EventBus
;
import
java.io.Serializable
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.concurrent.TimeUnit
;
import
ly.warp.sdk.R
;
import
ly.warp.sdk.io.models.ActiveDFYCouponEventModel
;
import
ly.warp.sdk.io.models.ActiveDFYCouponModel
;
import
ly.warp.sdk.io.models.Coupon
;
import
ly.warp.sdk.io.models.CouponList
;
import
ly.warp.sdk.io.models.Couponset
;
import
ly.warp.sdk.io.models.CouponsetsList
;
import
ly.warp.sdk.io.models.WarplyDealsAnalysisEventModel
;
import
ly.warp.sdk.utils.WarpUtils
;
import
ly.warp.sdk.utils.WarplyManagerHelper
;
import
ly.warp.sdk.utils.managers.WarplyEventBusManager
;
import
ly.warp.sdk.views.adapters.ActiveCouponAdapter
;
...
...
@@ -164,23 +157,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
// ===========================================================
private
void
initViews
()
{
CouponList
mCouponList
=
new
CouponList
();
CouponList
mCouponListInitial
=
new
CouponList
();
mCouponListInitial
.
addAll
(
WarplyManagerHelper
.
getCouponList
());
CouponsetsList
mCouponsetListInitial
=
new
CouponsetsList
();
mCouponsetListInitial
.
addAll
(
WarplyManagerHelper
.
getCouponsets
());
for
(
Coupon
coupon
:
mCouponListInitial
)
{
for
(
Couponset
couponset
:
mCouponsetListInitial
)
{
if
(
coupon
.
getCouponsetUuid
().
equals
(
couponset
.
getUuid
()))
{
coupon
.
setDescription
(
couponset
.
getShortDescription
());
coupon
.
setImage
(
couponset
.
getImgPreview
());
coupon
.
setName
(
couponset
.
getName
());
mCouponList
.
add
(
coupon
);
}
}
}
if
(
mCouponList
!=
null
)
{
if
(
WarplyManagerHelper
.
getCouponList
()
!=
null
)
{
mAdapterCoupons
=
new
ActiveCouponAdapter
(
this
,
WarplyManagerHelper
.
getCouponList
());
mRecyclerCoupons
.
setAdapter
(
mAdapterCoupons
);
mAdapterCoupons
.
getPositionClicks
()
...
...
@@ -194,6 +171,11 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
.
subscribe
();
}
if
(
WarplyManagerHelper
.
getLoyaltyBadge
()
!=
null
)
{
WarpUtils
.
log
(
"LOYALTY_BADGE_COUNT: "
+
String
.
valueOf
(
WarplyManagerHelper
.
getLoyaltyBadge
().
getCouponCount
()));
WarpUtils
.
log
(
"LOYALTY_BADGE_SUM: "
+
String
.
valueOf
(
WarplyManagerHelper
.
getLoyaltyBadge
().
getValue
()));
}
mTvGiftsValue
.
setText
(
String
.
format
(
getString
(
R
.
string
.
cos_value
),
String
.
valueOf
(
WarplyManagerHelper
.
getLoyaltyBadge
().
getValue
())));
mTvGiftsValueAll
.
setText
(
String
.
format
(
getString
(
R
.
string
.
cos_deals_win_title
),
String
.
valueOf
(
WarplyManagerHelper
.
getLoyaltyBadge
().
getValue
()),
String
.
valueOf
(
WarplyManagerHelper
.
getLoyaltyBadge
().
getCouponCount
())));
mTvDealsValue
.
setText
(
String
.
format
(
getString
(
R
.
string
.
cos_value
),
String
.
valueOf
(
/*couponDfyValue*/
WarplyManagerHelper
.
getDealsCouponsSum
())));
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/MoreForYouActivity.java
View file @
b4fd352
...
...
@@ -139,11 +139,11 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener
private
void
filterItems
()
{
ArrayList
<
Campaign
>
gfyList
=
new
ArrayList
<>();
if
(
WarplyManagerHelper
.
getCampaignList
()
!=
null
&&
WarplyManagerHelper
.
getCampaignList
().
size
()
>
0
)
{
Log
.
v
(
"Got L:{"
+
String
.
valueOf
(
WarplyManagerHelper
.
getCampaignList
().
size
())
+
"}"
,
" LOYALTY campaigns"
);
if
(
WarplyManagerHelper
.
getCampaignList
All
()
!=
null
&&
WarplyManagerHelper
.
getCampaignListAll
().
size
()
>
0
)
{
Log
.
v
(
"Got L:{"
+
String
.
valueOf
(
WarplyManagerHelper
.
getCampaignList
All
().
size
())
+
"}"
,
" LOYALTY campaigns"
);
if
(
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
()
==
null
||
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
().
size
()
==
0
)
{
Log
.
v
(
"Got C:{0}"
,
" CCMS campaigns"
);
for
(
Campaign
camp
:
WarplyManagerHelper
.
getCampaignList
())
{
for
(
Campaign
camp
:
WarplyManagerHelper
.
getCampaignList
All
())
{
if
(
camp
.
getOfferCategory
().
equals
(
"more_for_you"
))
{
try
{
JSONObject
extraFields
=
WarpJSONParser
.
getJSONFromString
(
camp
.
getExtraFields
());
...
...
@@ -160,7 +160,7 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener
}
else
{
int
ccmsCount
=
0
;
Log
.
v
(
"Got C:{"
+
String
.
valueOf
(
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
().
size
())
+
"}"
,
" CCMS campaigns"
);
for
(
Campaign
camp
:
WarplyManagerHelper
.
getCampaignList
())
{
for
(
Campaign
camp
:
WarplyManagerHelper
.
getCampaignList
All
())
{
if
(
camp
.
getOfferCategory
().
equals
(
"more_for_you"
))
{
try
{
JSONObject
extraFields
=
WarpJSONParser
.
getJSONFromString
(
camp
.
getExtraFields
());
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/WarpViewActivity.java
View file @
b4fd352
...
...
@@ -127,8 +127,8 @@ public class WarpViewActivity extends WarpBaseActivity {
setResult
(
RESULT_OK
,
new
Intent
());
finish
();
}
if
(
event
.
getCoupon
()
!=
null
)
finish
();
//
if (event.getCoupon() != null)
//
finish();
// if (event.getPacingCard() != null)
// finish();
// if (event.getPacingService() != null)
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/WarplyPacingEventModel.java
View file @
b4fd352
...
...
@@ -32,12 +32,12 @@ package ly.warp.sdk.io.models;
public
class
WarplyPacingEventModel
{
private
boolean
isVisible
=
false
;
private
boolean
isEnabled
=
false
;
//
private boolean isEnabled = false;
public
WarplyPacingEventModel
()
{
this
.
isVisible
=
false
;
this
.
isEnabled
=
false
;
//
this.isEnabled = false;
}
public
boolean
isVisible
()
{
...
...
@@ -48,11 +48,11 @@ public class WarplyPacingEventModel {
isVisible
=
visible
;
}
public
boolean
isEnabled
()
{
return
isEnabled
;
}
public
void
setEnabled
(
boolean
enabled
)
{
isEnabled
=
enabled
;
}
//
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 @
b4fd352
...
...
@@ -77,6 +77,7 @@ public class WarplyManagerHelper {
private
static
CouponsetsList
mCouponsetsList
=
new
CouponsetsList
();
private
static
CustomerStateModel
mCustomerStateModel
=
new
CustomerStateModel
();
private
static
CampaignList
mCampaignList
=
new
CampaignList
();
private
static
CampaignList
mCampaignListAll
=
new
CampaignList
();
private
static
ArrayList
<
ActiveDFYCouponModel
>
mDfyCoupons
=
new
ArrayList
();
private
static
ArrayList
<
LoyaltyGiftsForYouPackage
>
mSeasonalList
=
new
ArrayList
<>();
private
static
ArrayList
<
LoyaltyContextualOfferModel
>
mCCMSList
=
new
ArrayList
<>();
...
...
@@ -120,6 +121,7 @@ public class WarplyManagerHelper {
* Handle sharing flow
*/
public
static
void
handleSharing
(
Context
context
,
String
sharingId
)
{
WarpUtils
.
log
(
"SHARING_ID: "
+
sharingId
);
WarplyManager
.
cosmoteSharing
(
new
CosmoteSharingRequest
().
setSharingId
(
sharingId
),
new
CallbackReceiver
<
JSONObject
>()
{
@Override
public
void
onSuccess
(
JSONObject
result
)
{
...
...
@@ -274,7 +276,7 @@ public class WarplyManagerHelper {
public
static
String
constructCcmsUrl
(
Campaign
item
,
LoyaltyContextualOfferModel
ccmsItem
)
{
Log
.
v
(
"CCMS_PRESSED"
,
ccmsItem
.
getId
()
+
" "
+
ccmsItem
.
getOfferName
());
item
.
setNew
(
false
);
String
tempAudienceLevel
=
ccmsItem
.
getEligibleAssets
()
!=
null
&&
ccmsItem
.
getEligibleAssets
().
size
()
>
0
?
"MSISDN"
:
"GUID"
;
//
String tempAudienceLevel = ccmsItem.getEligibleAssets() != null && ccmsItem.getEligibleAssets().size() > 0 ? "MSISDN" : "GUID";
String
assets
=
""
;
if
(
ccmsItem
.
getEligibleAssets
()
!=
null
&&
ccmsItem
.
getEligibleAssets
().
size
()
>
0
)
{
for
(
String
singleAsset
:
ccmsItem
.
getEligibleAssets
())
{
...
...
@@ -313,7 +315,7 @@ public class WarplyManagerHelper {
+
"&WAVE="
+
ccmsItem
.
getWave
()
+
"&VALIDITY="
+
ccmsItem
.
getValidity
()
+
"&TREATMENT_CODE="
+
ccmsItem
.
getTreatmentCode
()
+
"&OfferAudienceLevel="
+
tempAudienceLevel
+
"&OfferAudienceLevel="
+
ccmsItem
.
getOfferAudienceLevel
()
+
"&ASSETS="
+
assets
+
"&ZONE="
+
ccmsItem
.
getZone
();
...
...
@@ -339,7 +341,7 @@ public class WarplyManagerHelper {
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 tempAudienceLevel = item.getEligibleAssets() != null && item.getEligibleAssets().size() > 0 ? "MSISDN" : "GUID";
String
assets
=
""
;
if
(
item
.
getEligibleAssets
()
!=
null
&&
item
.
getEligibleAssets
().
size
()
>
0
)
{
for
(
String
singleAsset
:
item
.
getEligibleAssets
())
{
...
...
@@ -379,7 +381,7 @@ public class WarplyManagerHelper {
+
"&WAVE="
+
item
.
getWave
()
+
"&VALIDITY="
+
item
.
getValidity
()
+
"&TREATMENT_CODE="
+
item
.
getTreatmentCode
()
+
"&OfferAudienceLevel="
+
tempAudienceLevel
+
"&OfferAudienceLevel="
+
item
.
getOfferAudienceLevel
()
+
"&ASSETS="
+
assets
+
"&ZONE="
+
item
.
getZone
();
break
;
...
...
@@ -518,7 +520,9 @@ public class WarplyManagerHelper {
if
(
mCampaignList
!=
null
&&
mCampaignList
.
size
()
>
0
)
{
for
(
Campaign
camp
:
mCampaignList
)
{
if
(
camp
.
getOfferCategory
().
equals
(
"pacing"
))
{
return
constructCampaignUrl
(
camp
);
String
pacingUrl
=
constructCampaignUrl
(
camp
);
WarpUtils
.
log
(
"PACING_LOG: "
+
pacingUrl
);
return
pacingUrl
;
}
}
}
...
...
@@ -589,6 +593,11 @@ public class WarplyManagerHelper {
}
public
static
CouponList
getCouponList
()
{
if
(
mCouponList
!=
null
&&
mCouponList
.
size
()
>
0
)
{
WarpUtils
.
log
(
"GET_COUPON_LIST size: "
+
String
.
valueOf
(
mCouponList
.
size
()));
}
else
{
WarpUtils
.
log
(
"GET_COUPON_LIST size: 0"
);
}
return
mCouponList
;
}
...
...
@@ -617,14 +626,35 @@ public class WarplyManagerHelper {
}
public
static
void
setCampaignList
(
CampaignList
campaignList
)
{
// mCampaignList.clear();
// mCampaignList.addAll(campaignList);
mCampaignListAll
.
clear
();
mCampaignListAll
.
addAll
(
campaignList
);
mCampaignList
.
clear
();
mCampaignList
.
addAll
(
campaignList
);
for
(
Campaign
camp
:
campaignList
)
{
try
{
JSONObject
extraFields
=
WarpJSONParser
.
getJSONFromString
(
camp
.
getExtraFields
());
if
(
extraFields
!=
null
)
{
if
(
extraFields
.
length
()
==
0
||
!
extraFields
.
has
(
"ccms_offer"
))
{
mCampaignList
.
add
(
camp
);
}
}
}
catch
(
Exception
exception
)
{
mCampaignList
.
add
(
camp
);
}
}
}
public
static
CampaignList
getCampaignList
()
{
return
mCampaignList
;
}
public
static
CampaignList
getCampaignListAll
()
{
return
mCampaignListAll
;
}
public
static
void
setCouponList
(
CouponList
couponList
)
{
LoyaltyBadgeModel
badge
=
new
LoyaltyBadgeModel
();
CouponList
cpnlist
=
new
CouponList
();
...
...
@@ -632,19 +662,13 @@ public class WarplyManagerHelper {
int
couponCount
=
0
;
for
(
Coupon
coupon
:
couponList
)
{
if
(
coupon
.
getStatus
()
==
1
)
{
try
{
float
tempCouponValue
=
Float
.
parseFloat
(
coupon
.
getDiscount
());
cpnlist
.
add
(
coupon
);
}
catch
(
NumberFormatException
e
)
{
cpnlist
.
remove
(
coupon
);
}
}
else
if
(
coupon
.
getStatus
()
==
0
)
{
try
{
couponCount
+=
1
;
couponValue
+=
Float
.
parseFloat
(
coupon
.
getDiscount
());
}
catch
(
NumberFormatException
e
)
{
couponCount
-=
1
;
cpnlist
.
remove
(
coupon
);
}
}
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
View file @
b4fd352
...
...
@@ -107,6 +107,7 @@ import ly.warp.sdk.io.request.WarplyUserCouponsRequest;
import
ly.warp.sdk.io.request.WarplyValidateCouponRequest
;
import
ly.warp.sdk.io.request.WarplyVerifyOTPRequest
;
import
ly.warp.sdk.io.request.WarplyVerifyTicketRequest
;
import
ly.warp.sdk.utils.WarpJSONParser
;
import
ly.warp.sdk.utils.WarpUtils
;
import
ly.warp.sdk.utils.WarplyManagerHelper
;
import
ly.warp.sdk.utils.WarplyProperty
;
...
...
@@ -778,6 +779,26 @@ public class WarplyManager {
e
.
printStackTrace
();
receiver
.
onFailure
(
2
);
}
getConsumer
(
new
WarplyConsumerRequest
(),
new
CallbackReceiver
<
Consumer
>()
{
@Override
public
void
onSuccess
(
Consumer
result
)
{
WarplyManagerHelper
.
setConsumer
(
result
);
if
(
result
!=
null
)
{
JSONObject
profMetadata
=
WarpJSONParser
.
getJSONFromString
(
result
.
getProfileMetadata
());
if
(
profMetadata
!=
null
)
{
if
(
profMetadata
.
has
(
"badge"
))
{
WarpUtils
.
setUserTag
(
Warply
.
getWarplyContext
(),
profMetadata
.
optString
(
"badge"
));
}
}
}
}
@Override
public
void
onFailure
(
int
errorCode
)
{
}
});
}
else
receiver
.
onFailure
(
2
);
}
else
...
...
@@ -799,19 +820,19 @@ public class WarplyManager {
Warply
.
postReceiveMicroappData
(
WarpConstants
.
MICROAPP_COUPONS
,
true
,
"context"
,
request
.
toJson
(),
new
CouponsHook
(
new
CallbackReceiver
<
CouponList
>()
{
@Override
public
void
onSuccess
(
CouponList
result
)
{
CouponList
mCouponList
=
new
CouponList
();
for
(
Coupon
coupon
:
result
)
{
for
(
Couponset
couponset
:
WarplyManagerHelper
.
getCouponsets
())
{
if
(
coupon
.
getCouponsetUuid
().
equals
(
couponset
.
getUuid
()))
{
coupon
.
setDescription
(
couponset
.
getShortDescription
());
coupon
.
setImage
(
couponset
.
getImgPreview
());
coupon
.
setName
(
couponset
.
getName
());
mCouponList
.
add
(
coupon
);
}
}
}
WarplyManagerHelper
.
setCouponList
(
mCouponList
);
receiver
.
onSuccess
(
mCouponLis
t
);
//
CouponList mCouponList = new CouponList();
//
for (Coupon coupon : result) {
//
for (Couponset couponset : WarplyManagerHelper.getCouponsets()) {
//
if (coupon.getCouponsetUuid().equals(couponset.getUuid())) {
//
coupon.setDescription(couponset.getShortDescription());
//
coupon.setImage(couponset.getImgPreview());
//
coupon.setName(couponset.getName());
//
mCouponList.add(coupon);
//
}
//
}
//
}
//
WarplyManagerHelper.setCouponList(mCouponList);
receiver
.
onSuccess
(
/*mCouponList*/
resul
t
);
}
@Override
...
...
@@ -1618,6 +1639,26 @@ public class WarplyManager {
e
.
printStackTrace
();
receiver
.
onFailure
(
2
);
}
getConsumer
(
new
WarplyConsumerRequest
(),
new
CallbackReceiver
<
Consumer
>()
{
@Override
public
void
onSuccess
(
Consumer
result
)
{
WarplyManagerHelper
.
setConsumer
(
result
);
if
(
result
!=
null
)
{
JSONObject
profMetadata
=
WarpJSONParser
.
getJSONFromString
(
result
.
getProfileMetadata
());
if
(
profMetadata
!=
null
)
{
if
(
profMetadata
.
has
(
"badge"
))
{
WarpUtils
.
setUserTag
(
Warply
.
getWarplyContext
(),
profMetadata
.
optString
(
"badge"
));
}
}
}
}
@Override
public
void
onFailure
(
int
errorCode
)
{
}
});
}
else
receiver
.
onFailure
(
2
);
}
else
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/WarpView.java
View file @
b4fd352
...
...
@@ -396,8 +396,10 @@ public class WarpView extends WebView {
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
questionnaireEvent
));
}
}
else
if
(
parts
[
1
].
equals
(
"couponRetrieved"
))
{
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
new
CouponEventModel
()));
}
else
if
(
parts
[
1
].
equals
(
"couponShared"
))
{
// EventBus.getDefault().post(new WarplyEventBusManager(new CouponEventModel()));
}
else
if
(
parts
[
2
].
equals
(
"serviceDisabled"
))
{
}
/*
else if (parts[2].equals("serviceDisabled")) {
// WorkManager.getInstance(Warply.getWarplyContext()).cancelAllWorkByTag(UpdateUserLocationService.TAG);
WarplyPacingEventModel pacingService = new WarplyPacingEventModel();
pacingService.setEnabled(false);
...
...
@@ -407,11 +409,11 @@ public class WarpView extends WebView {
WarplyPacingEventModel pacingService = new WarplyPacingEventModel();
pacingService.setEnabled(true);
EventBus.getDefault().post(new WarplyEventBusManager(pacingService));
}
else
if
(
parts
[
2
].
equals
(
"shortcutEnabled"
))
{
}
*/
else
if
(
parts
[
1
].
equals
(
"steps"
)
&&
parts
[
2
].
equals
(
"shortcutEnabled"
))
{
WarplyPacingEventModel
pacingVisible
=
new
WarplyPacingEventModel
();
pacingVisible
.
setVisible
(
true
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
pacingVisible
));
}
else
if
(
parts
[
2
].
equals
(
"shortcutDisabled"
))
{
}
else
if
(
parts
[
1
].
equals
(
"steps"
)
&&
parts
[
2
].
equals
(
"shortcutDisabled"
))
{
WarplyPacingEventModel
pacingVisible
=
new
WarplyPacingEventModel
();
pacingVisible
.
setVisible
(
false
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
pacingVisible
));
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/ActiveCouponAdapter.java
View file @
b4fd352
...
...
@@ -129,7 +129,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
else
holder
.
tvCouponDate
.
setText
(
String
.
format
(
mContext
.
getString
(
R
.
string
.
cos_coupon_date
),
simpleDateFormat
.
format
(
newDate
!=
null
?
newDate
:
""
)));
holder
.
tvCouponValue
.
setText
(
couponItem
.
getDiscount
()
+
mContext
.
getResources
().
getString
(
R
.
string
.
euro
)
);
holder
.
tvCouponValue
.
setText
(
couponItem
.
getDiscount
());
holder
.
itemView
.
setOnClickListener
(
v
->
onClickSubject
.
onNext
(
couponItem
));
}
}
...
...
Please
register
or
login
to post a comment