Showing
13 changed files
with
432 additions
and
382 deletions
... | @@ -42,7 +42,7 @@ public class SplashActivity extends BaseActivity { | ... | @@ -42,7 +42,7 @@ public class SplashActivity extends BaseActivity { |
42 | // ); | 42 | // ); |
43 | 43 | ||
44 | WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest() | 44 | WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest() |
45 | - .setGuid("6012049321"), | 45 | + .setGuid("6012049322"), |
46 | mLoginReceiver); | 46 | mLoginReceiver); |
47 | 47 | ||
48 | // WarplyManager.verifyTicket(new WarplyVerifyTicketRequest() | 48 | // WarplyManager.verifyTicket(new WarplyVerifyTicketRequest() | ... | ... |
... | @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' | ... | @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' |
2 | 2 | ||
3 | ext { | 3 | ext { |
4 | PUBLISH_GROUP_ID = 'ly.warp' | 4 | PUBLISH_GROUP_ID = 'ly.warp' |
5 | - PUBLISH_VERSION = '4.5.4-cosbeta29' | 5 | + PUBLISH_VERSION = '4.5.4-cosbeta30i' |
6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' |
7 | } | 7 | } |
8 | 8 | ... | ... |
... | @@ -479,299 +479,299 @@ public enum Warply { | ... | @@ -479,299 +479,299 @@ public enum Warply { |
479 | public void onSuccess(CampaignList result) { | 479 | public void onSuccess(CampaignList result) { |
480 | WarplyManagerHelper.setCampaignList(result); | 480 | WarplyManagerHelper.setCampaignList(result); |
481 | 481 | ||
482 | -// ArrayList<LoyaltyContextualOfferModel> list = new ArrayList<>(); | 482 | + ArrayList<LoyaltyContextualOfferModel> list = new ArrayList<>(); |
483 | -// JSONArray jArray = null; | 483 | + JSONArray jArray = null; |
484 | -// try { | 484 | + try { |
485 | -// jArray = new JSONArray("[\n" + | 485 | + jArray = new JSONArray("[\n" + |
486 | -// " {\n" + | 486 | + " {\n" + |
487 | -// " \"UACIOfferTrackingCode\": \"5166.e07.fffffffffa10663a.ffffffffda30c76a\",\n" + | 487 | + " \"UACIOfferTrackingCode\": \"5166.e07.fffffffffa10663a.ffffffffda30c76a\",\n" + |
488 | -// " \"businessAdditionalId\": \"\",\n" + | 488 | + " \"businessAdditionalId\": \"\",\n" + |
489 | -// " \"dataCategory\": \"Data\",\n" + | 489 | + " \"dataCategory\": \"Data\",\n" + |
490 | -// " \"dataValue\": \"None\",\n" + | 490 | + " \"dataValue\": \"None\",\n" + |
491 | -// " \"discount\": \"None\",\n" + | 491 | + " \"discount\": \"None\",\n" + |
492 | -// " \"eligibleAssets\": [\n" + | 492 | + " \"eligibleAssets\": [\n" + |
493 | -// " \"306945218770\"\n" + | 493 | + " \"306945218770\"\n" + |
494 | -// " ],\n" + | 494 | + " ],\n" + |
495 | -// " \"id\": \"000003590\",\n" + | 495 | + " \"id\": \"000003590\",\n" + |
496 | -// " \"loyaltyCampaignId\": \"NA\",\n" + | 496 | + " \"loyaltyCampaignId\": \"NA\",\n" + |
497 | -// " \"minsValue\": \"None\",\n" + | 497 | + " \"minsValue\": \"None\",\n" + |
498 | -// " \"noOfRecurrance\": \"None\",\n" + | 498 | + " \"noOfRecurrance\": \"None\",\n" + |
499 | -// " \"notificationMessage\": \"None\",\n" + | 499 | + " \"notificationMessage\": \"None\",\n" + |
500 | -// " \"offerAudienceLevel\": \"msisdn\",\n" + | 500 | + " \"offerAudienceLevel\": \"msisdn\",\n" + |
501 | -// " \"offerCode1\": \"000003590\",\n" + | 501 | + " \"offerCode1\": \"000003590\",\n" + |
502 | -// " \"offerName\": \"CCMS loyalty white label\",\n" + | 502 | + " \"offerName\": \"CCMS loyalty white label\",\n" + |
503 | -// " \"price\": \"None\",\n" + | 503 | + " \"price\": \"None\",\n" + |
504 | -// " \"productType\": \"White Label\",\n" + | 504 | + " \"productType\": \"White Label\",\n" + |
505 | -// " \"provDuration\": \"0.0\",\n" + | 505 | + " \"provDuration\": \"0.0\",\n" + |
506 | -// " \"provStepValueMins\": \"None\",\n" + | 506 | + " \"provStepValueMins\": \"None\",\n" + |
507 | -// " \"score\": \"50\",\n" + | 507 | + " \"score\": \"50\",\n" + |
508 | -// " \"treatmentCode\": \"5166.e07.fffffffffa10663a.ffffffffda30c76a\",\n" + | 508 | + " \"treatmentCode\": \"5166.e07.fffffffffa10663a.ffffffffda30c76a\",\n" + |
509 | -// " \"validity\": \"0\",\n" + | 509 | + " \"validity\": \"0\",\n" + |
510 | -// " \"voiceCategory\": \"None\",\n" + | 510 | + " \"voiceCategory\": \"None\",\n" + |
511 | -// " \"wave\": \"1\",\n" + | 511 | + " \"wave\": \"1\",\n" + |
512 | -// " \"zone\": \"COSMOTE_APP_LOYALTY_PROMO\"\n" + | 512 | + " \"zone\": \"COSMOTE_APP_LOYALTY_PROMO\"\n" + |
513 | -// " },\n" + | 513 | + " },\n" + |
514 | -// " {\n" + | 514 | + " {\n" + |
515 | -// " \"UACIOfferTrackingCode\": \"51ed.e10.2c006f18.71e96d08\",\n" + | 515 | + " \"UACIOfferTrackingCode\": \"51ed.e10.2c006f18.71e96d08\",\n" + |
516 | -// " \"businessAdditionalId\": \"\",\n" + | 516 | + " \"businessAdditionalId\": \"\",\n" + |
517 | -// " \"dataCategory\": \"Data\",\n" + | 517 | + " \"dataCategory\": \"Data\",\n" + |
518 | -// " \"dataValue\": \"None\",\n" + | 518 | + " \"dataValue\": \"None\",\n" + |
519 | -// " \"discount\": \"None\",\n" + | 519 | + " \"discount\": \"None\",\n" + |
520 | -// " \"eligibleAssets\": [\n" + | 520 | + " \"eligibleAssets\": [\n" + |
521 | -// " \"306945218770\"\n" + | 521 | + " \"306945218770\"\n" + |
522 | -// " ],\n" + | 522 | + " ],\n" + |
523 | -// " \"id\": \"000003599\",\n" + | 523 | + " \"id\": \"000003599\",\n" + |
524 | -// " \"loyaltyCampaignId\": \"c5cc5f4f65624f47a580b720233fa60d\",\n" + | 524 | + " \"loyaltyCampaignId\": \"c5cc5f4f65624f47a580b720233fa60d\",\n" + |
525 | -// " \"minsValue\": \"None\",\n" + | 525 | + " \"minsValue\": \"None\",\n" + |
526 | -// " \"noOfRecurrance\": \"None\",\n" + | 526 | + " \"noOfRecurrance\": \"None\",\n" + |
527 | -// " \"notificationMessage\": \"None\",\n" + | 527 | + " \"notificationMessage\": \"None\",\n" + |
528 | -// " \"offerAudienceLevel\": \"msisdn\",\n" + | 528 | + " \"offerAudienceLevel\": \"msisdn\",\n" + |
529 | -// " \"offerCode1\": \"000003599\",\n" + | 529 | + " \"offerCode1\": \"000003599\",\n" + |
530 | -// " \"offerName\": \"CCMS loyalty white label with campaignId\",\n" + | 530 | + " \"offerName\": \"CCMS loyalty white label with campaignId\",\n" + |
531 | -// " \"price\": \"None\",\n" + | 531 | + " \"price\": \"None\",\n" + |
532 | -// " \"productType\": \"White Label\",\n" + | 532 | + " \"productType\": \"White Label\",\n" + |
533 | -// " \"provDuration\": \"0.0\",\n" + | 533 | + " \"provDuration\": \"0.0\",\n" + |
534 | -// " \"provStepValueMins\": \"None\",\n" + | 534 | + " \"provStepValueMins\": \"None\",\n" + |
535 | -// " \"score\": \"50\",\n" + | 535 | + " \"score\": \"50\",\n" + |
536 | -// " \"treatmentCode\": \"51ed.e10.2c006f18.71e96d08\",\n" + | 536 | + " \"treatmentCode\": \"51ed.e10.2c006f18.71e96d08\",\n" + |
537 | -// " \"validity\": \"0\",\n" + | 537 | + " \"validity\": \"0\",\n" + |
538 | -// " \"voiceCategory\": \"None\",\n" + | 538 | + " \"voiceCategory\": \"None\",\n" + |
539 | -// " \"wave\": \"1\",\n" + | 539 | + " \"wave\": \"1\",\n" + |
540 | -// " \"zone\": \"COSMOTE_APP_LOYALTY_PROMO\"\n" + | 540 | + " \"zone\": \"COSMOTE_APP_LOYALTY_PROMO\"\n" + |
541 | -// " },\n" + | 541 | + " },\n" + |
542 | -// " {\n" + | 542 | + " {\n" + |
543 | -// " \"UACIOfferTrackingCode\": \"516c.e05.ffffffffa943695b.79ff470b\",\n" + | 543 | + " \"UACIOfferTrackingCode\": \"516c.e05.ffffffffa943695b.79ff470b\",\n" + |
544 | -// " \"businessAdditionalId\": \"\",\n" + | 544 | + " \"businessAdditionalId\": \"\",\n" + |
545 | -// " \"businessService\": \"0.0\",\n" + | 545 | + " \"businessService\": \"0.0\",\n" + |
546 | -// " \"eligibleAssets\": [\n" + | 546 | + " \"eligibleAssets\": [\n" + |
547 | -// " \"306945218770\"\n" + | 547 | + " \"306945218770\"\n" + |
548 | -// " ],\n" + | 548 | + " ],\n" + |
549 | -// " \"id\": \"000003588\",\n" + | 549 | + " \"id\": \"000003588\",\n" + |
550 | -// " \"loyaltyCampaignId\": \"NA\",\n" + | 550 | + " \"loyaltyCampaignId\": \"NA\",\n" + |
551 | -// " \"noOfRecurrance\": \"0\",\n" + | 551 | + " \"noOfRecurrance\": \"0\",\n" + |
552 | -// " \"notificationMessage\": \"None\",\n" + | 552 | + " \"notificationMessage\": \"None\",\n" + |
553 | -// " \"offerAudienceLevel\": \"msisdn\",\n" + | 553 | + " \"offerAudienceLevel\": \"msisdn\",\n" + |
554 | -// " \"offerCode1\": \"000003588\",\n" + | 554 | + " \"offerCode1\": \"000003588\",\n" + |
555 | -// " \"offerName\": \"CCMS loyalty postpay addon\",\n" + | 555 | + " \"offerName\": \"CCMS loyalty postpay addon\",\n" + |
556 | -// " \"postpayProduct\": \"0.0\",\n" + | 556 | + " \"postpayProduct\": \"0.0\",\n" + |
557 | -// " \"price\": \"None\",\n" + | 557 | + " \"price\": \"None\",\n" + |
558 | -// " \"productType\": \"MOBILE ADDON\",\n" + | 558 | + " \"productType\": \"MOBILE ADDON\",\n" + |
559 | -// " \"provDuration\": \"0.0\",\n" + | 559 | + " \"provDuration\": \"0.0\",\n" + |
560 | -// " \"score\": \"50\",\n" + | 560 | + " \"score\": \"50\",\n" + |
561 | -// " \"treatmentCode\": \"516c.e05.ffffffffa943695b.79ff470b\",\n" + | 561 | + " \"treatmentCode\": \"516c.e05.ffffffffa943695b.79ff470b\",\n" + |
562 | -// " \"validity\": \"0\",\n" + | 562 | + " \"validity\": \"0\",\n" + |
563 | -// " \"wave\": \"1\",\n" + | 563 | + " \"wave\": \"1\",\n" + |
564 | -// " \"zone\": \"COSMOTE_APP_LOYALTY_PROMO\"\n" + | 564 | + " \"zone\": \"COSMOTE_APP_LOYALTY_PROMO\"\n" + |
565 | -// " },\n" + | 565 | + " },\n" + |
566 | -// " {\n" + | 566 | + " {\n" + |
567 | -// " \"UACIOfferTrackingCode\": \"5224.e19.30e2f27b.ffffffffeb22b0db\",\n" + | 567 | + " \"UACIOfferTrackingCode\": \"5224.e19.30e2f27b.ffffffffeb22b0db\",\n" + |
568 | -// " \"businessAdditionalId\": \"\",\n" + | 568 | + " \"businessAdditionalId\": \"\",\n" + |
569 | -// " \"dataCategory\": \"Data\",\n" + | 569 | + " \"dataCategory\": \"Data\",\n" + |
570 | -// " \"dataValue\": \"None\",\n" + | 570 | + " \"dataValue\": \"None\",\n" + |
571 | -// " \"discount\": \"None\",\n" + | 571 | + " \"discount\": \"None\",\n" + |
572 | -// " \"eligibleAssets\": [\n" + | 572 | + " \"eligibleAssets\": [\n" + |
573 | -// " \"306945218770\"\n" + | 573 | + " \"306945218770\"\n" + |
574 | -// " ],\n" + | 574 | + " ],\n" + |
575 | -// " \"id\": \"000003608\",\n" + | 575 | + " \"id\": \"000003608\",\n" + |
576 | -// " \"loyaltyCampaignId\": \"c134cdeb8a924f8eac38e261acb9caf5\",\n" + | 576 | + " \"loyaltyCampaignId\": \"c134cdeb8a924f8eac38e261acb9caf5\",\n" + |
577 | -// " \"minsValue\": \"None\",\n" + | 577 | + " \"minsValue\": \"None\",\n" + |
578 | -// " \"noOfRecurrance\": \"None\",\n" + | 578 | + " \"noOfRecurrance\": \"None\",\n" + |
579 | -// " \"notificationMessage\": \"None\",\n" + | 579 | + " \"notificationMessage\": \"None\",\n" + |
580 | -// " \"offerAudienceLevel\": \"msisdn\",\n" + | 580 | + " \"offerAudienceLevel\": \"msisdn\",\n" + |
581 | -// " \"offerCode1\": \"000003608\",\n" + | 581 | + " \"offerCode1\": \"000003608\",\n" + |
582 | -// " \"offerName\": \"CCMS loyalty gifts4u v1\",\n" + | 582 | + " \"offerName\": \"CCMS loyalty gifts4u v1\",\n" + |
583 | -// " \"price\": \"None\",\n" + | 583 | + " \"price\": \"None\",\n" + |
584 | -// " \"productType\": \"White Label\",\n" + | 584 | + " \"productType\": \"White Label\",\n" + |
585 | -// " \"provDuration\": \"0.0\",\n" + | 585 | + " \"provDuration\": \"0.0\",\n" + |
586 | -// " \"provStepValueMins\": \"None\",\n" + | 586 | + " \"provStepValueMins\": \"None\",\n" + |
587 | -// " \"score\": \"50\",\n" + | 587 | + " \"score\": \"50\",\n" + |
588 | -// " \"treatmentCode\": \"5224.e19.30e2f27b.ffffffffeb22b0db\",\n" + | 588 | + " \"treatmentCode\": \"5224.e19.30e2f27b.ffffffffeb22b0db\",\n" + |
589 | -// " \"validity\": \"0\",\n" + | 589 | + " \"validity\": \"0\",\n" + |
590 | -// " \"voiceCategory\": \"None\",\n" + | 590 | + " \"voiceCategory\": \"None\",\n" + |
591 | -// " \"wave\": \"1\",\n" + | 591 | + " \"wave\": \"1\",\n" + |
592 | -// " \"zone\": \"COSMOTE_APP_GIFTS4U\"\n" + | 592 | + " \"zone\": \"COSMOTE_APP_GIFTS4U\"\n" + |
593 | -// " },\n" + | 593 | + " },\n" + |
594 | -// " {\n" + | 594 | + " {\n" + |
595 | -// " \"UACIOfferTrackingCode\": \"5228.e1d.38378e61.750186c1\",\n" + | 595 | + " \"UACIOfferTrackingCode\": \"5228.e1d.38378e61.750186c1\",\n" + |
596 | -// " \"businessAdditionalId\": \"\",\n" + | 596 | + " \"businessAdditionalId\": \"\",\n" + |
597 | -// " \"businessService\": \"0.0\",\n" + | 597 | + " \"businessService\": \"0.0\",\n" + |
598 | -// " \"eligibleAssets\": [\n" + | 598 | + " \"eligibleAssets\": [\n" + |
599 | -// " \"306945218770\"\n" + | 599 | + " \"306945218770\"\n" + |
600 | -// " ],\n" + | 600 | + " ],\n" + |
601 | -// " \"id\": \"000003612\",\n" + | 601 | + " \"id\": \"000003612\",\n" + |
602 | -// " \"loyaltyCampaignId\": \"8eb71c4ceaff409c896e2d1f6f1c20f3\",\n" + | 602 | + " \"loyaltyCampaignId\": \"8eb71c4ceaff409c896e2d1f6f1c20f3\",\n" + |
603 | -// " \"noOfRecurrance\": \"0\",\n" + | 603 | + " \"noOfRecurrance\": \"0\",\n" + |
604 | -// " \"notificationMessage\": \"None\",\n" + | 604 | + " \"notificationMessage\": \"None\",\n" + |
605 | -// " \"offerAudienceLevel\": \"msisdn\",\n" + | 605 | + " \"offerAudienceLevel\": \"msisdn\",\n" + |
606 | -// " \"offerCode1\": \"000003612\",\n" + | 606 | + " \"offerCode1\": \"000003612\",\n" + |
607 | -// " \"offerName\": \"CCMS loyalty - postpay addon gifts4u\",\n" + | 607 | + " \"offerName\": \"CCMS loyalty - postpay addon gifts4u\",\n" + |
608 | -// " \"postpayProduct\": \"0.0\",\n" + | 608 | + " \"postpayProduct\": \"0.0\",\n" + |
609 | -// " \"price\": \"None\",\n" + | 609 | + " \"price\": \"None\",\n" + |
610 | -// " \"productType\": \"MOBILE ADDON\",\n" + | 610 | + " \"productType\": \"MOBILE ADDON\",\n" + |
611 | -// " \"provDuration\": \"0.0\",\n" + | 611 | + " \"provDuration\": \"0.0\",\n" + |
612 | -// " \"score\": \"50\",\n" + | 612 | + " \"score\": \"50\",\n" + |
613 | -// " \"treatmentCode\": \"5228.e1d.38378e61.750186c1\",\n" + | 613 | + " \"treatmentCode\": \"5228.e1d.38378e61.750186c1\",\n" + |
614 | -// " \"validity\": \"0\",\n" + | 614 | + " \"validity\": \"0\",\n" + |
615 | -// " \"wave\": \"1\",\n" + | 615 | + " \"wave\": \"1\",\n" + |
616 | -// " \"zone\": \"COSMOTE_APP_GIFTS4U\"\n" + | 616 | + " \"zone\": \"COSMOTE_APP_GIFTS4U\"\n" + |
617 | -// " },\n" + | 617 | + " },\n" + |
618 | -// " {\n" + | 618 | + " {\n" + |
619 | -// " \"UACIOfferTrackingCode\": \"5222.e1b.ffffffffe725d1b3.ffffffffed6d8723\",\n" + | 619 | + " \"UACIOfferTrackingCode\": \"5222.e1b.ffffffffe725d1b3.ffffffffed6d8723\",\n" + |
620 | -// " \"businessAdditionalId\": \"\",\n" + | 620 | + " \"businessAdditionalId\": \"\",\n" + |
621 | -// " \"dataCategory\": \"Data\",\n" + | 621 | + " \"dataCategory\": \"Data\",\n" + |
622 | -// " \"dataValue\": \"None\",\n" + | 622 | + " \"dataValue\": \"None\",\n" + |
623 | -// " \"discount\": \"None\",\n" + | 623 | + " \"discount\": \"None\",\n" + |
624 | -// " \"eligibleAssets\": [\n" + | 624 | + " \"eligibleAssets\": [\n" + |
625 | -// " \"306945218770\"\n" + | 625 | + " \"306945218770\"\n" + |
626 | -// " ],\n" + | 626 | + " ],\n" + |
627 | -// " \"id\": \"000003610\",\n" + | 627 | + " \"id\": \"000003610\",\n" + |
628 | -// " \"loyaltyCampaignId\": \"8e2c88ec94c948d8b51577324ed9a4d5\",\n" + | 628 | + " \"loyaltyCampaignId\": \"8e2c88ec94c948d8b51577324ed9a4d5\",\n" + |
629 | -// " \"minsValue\": \"None\",\n" + | 629 | + " \"minsValue\": \"None\",\n" + |
630 | -// " \"noOfRecurrance\": \"None\",\n" + | 630 | + " \"noOfRecurrance\": \"None\",\n" + |
631 | -// " \"notificationMessage\": \"None\",\n" + | 631 | + " \"notificationMessage\": \"None\",\n" + |
632 | -// " \"offerAudienceLevel\": \"msisdn\",\n" + | 632 | + " \"offerAudienceLevel\": \"msisdn\",\n" + |
633 | -// " \"offerCode1\": \"000003610\",\n" + | 633 | + " \"offerCode1\": \"000003610\",\n" + |
634 | -// " \"offerName\": \"CCMS loyalty more4u v1\",\n" + | 634 | + " \"offerName\": \"CCMS loyalty more4u v1\",\n" + |
635 | -// " \"price\": \"20\",\n" + | 635 | + " \"price\": \"20\",\n" + |
636 | -// " \"productType\": \"White Label\",\n" + | 636 | + " \"productType\": \"White Label\",\n" + |
637 | -// " \"provDuration\": \"7.0\",\n" + | 637 | + " \"provDuration\": \"7.0\",\n" + |
638 | -// " \"provStepValueMins\": \"None\",\n" + | 638 | + " \"provStepValueMins\": \"None\",\n" + |
639 | -// " \"score\": \"60\",\n" + | 639 | + " \"score\": \"60\",\n" + |
640 | -// " \"treatmentCode\": \"5222.e1b.ffffffffe725d1b3.ffffffffed6d8723\",\n" + | 640 | + " \"treatmentCode\": \"5222.e1b.ffffffffe725d1b3.ffffffffed6d8723\",\n" + |
641 | -// " \"validity\": \"0\",\n" + | 641 | + " \"validity\": \"0\",\n" + |
642 | -// " \"voiceCategory\": \"None\",\n" + | 642 | + " \"voiceCategory\": \"None\",\n" + |
643 | -// " \"wave\": \"1\",\n" + | 643 | + " \"wave\": \"1\",\n" + |
644 | -// " \"zone\": \"COSMOTE_APP_MORE4U\"\n" + | 644 | + " \"zone\": \"COSMOTE_APP_MORE4U\"\n" + |
645 | -// " },\n" + | 645 | + " },\n" + |
646 | -// " {\n" + | 646 | + " {\n" + |
647 | -// " \"UACIOfferTrackingCode\": \"5226.e1f.728b68c6.ffffffffa6c7b10e\",\n" + | 647 | + " \"UACIOfferTrackingCode\": \"5226.e1f.728b68c6.ffffffffa6c7b10e\",\n" + |
648 | -// " \"businessAdditionalId\": \"\",\n" + | 648 | + " \"businessAdditionalId\": \"\",\n" + |
649 | -// " \"businessService\": \"0.0\",\n" + | 649 | + " \"businessService\": \"0.0\",\n" + |
650 | -// " \"eligibleAssets\": [\n" + | 650 | + " \"eligibleAssets\": [\n" + |
651 | -// " \"306945218770\"\n" + | 651 | + " \"306945218770\"\n" + |
652 | -// " ],\n" + | 652 | + " ],\n" + |
653 | -// " \"id\": \"000003614\",\n" + | 653 | + " \"id\": \"000003614\",\n" + |
654 | -// " \"loyaltyCampaignId\": \"aaf4022194584f02bb84c7b283c7c51e\",\n" + | 654 | + " \"loyaltyCampaignId\": \"aaf4022194584f02bb84c7b283c7c51e\",\n" + |
655 | -// " \"noOfRecurrance\": \"0\",\n" + | 655 | + " \"noOfRecurrance\": \"0\",\n" + |
656 | -// " \"notificationMessage\": \"None\",\n" + | 656 | + " \"notificationMessage\": \"None\",\n" + |
657 | -// " \"offerAudienceLevel\": \"msisdn\",\n" + | 657 | + " \"offerAudienceLevel\": \"msisdn\",\n" + |
658 | -// " \"offerCode1\": \"000003614\",\n" + | 658 | + " \"offerCode1\": \"000003614\",\n" + |
659 | -// " \"offerName\": \"CCMS loyalty - postpay addon more4u\",\n" + | 659 | + " \"offerName\": \"CCMS loyalty - postpay addon more4u\",\n" + |
660 | -// " \"postpayProduct\": \"0.0\",\n" + | 660 | + " \"postpayProduct\": \"0.0\",\n" + |
661 | -// " \"price\": \"None\",\n" + | 661 | + " \"price\": \"None\",\n" + |
662 | -// " \"productType\": \"MOBILE ADDON\",\n" + | 662 | + " \"productType\": \"MOBILE ADDON\",\n" + |
663 | -// " \"provDuration\": \"0.0\",\n" + | 663 | + " \"provDuration\": \"0.0\",\n" + |
664 | -// " \"score\": \"50\",\n" + | 664 | + " \"score\": \"50\",\n" + |
665 | -// " \"treatmentCode\": \"5226.e1f.728b68c6.ffffffffa6c7b10e\",\n" + | 665 | + " \"treatmentCode\": \"5226.e1f.728b68c6.ffffffffa6c7b10e\",\n" + |
666 | -// " \"validity\": \"0\",\n" + | 666 | + " \"validity\": \"0\",\n" + |
667 | -// " \"wave\": \"1\",\n" + | 667 | + " \"wave\": \"1\",\n" + |
668 | -// " \"zone\": \"COSMOTE_APP_MORE4U\"\n" + | 668 | + " \"zone\": \"COSMOTE_APP_MORE4U\"\n" + |
669 | -// " },\n" + | 669 | + " },\n" + |
670 | -// " {\n" + | 670 | + " {\n" + |
671 | -// " \"UACIOfferTrackingCode\": \"5154.e03.ffffffffeebc476a.ffffffffc5b96f6a\",\n" + | 671 | + " \"UACIOfferTrackingCode\": \"5154.e03.ffffffffeebc476a.ffffffffc5b96f6a\",\n" + |
672 | -// " \"businessAdditionalId\": \"\",\n" + | 672 | + " \"businessAdditionalId\": \"\",\n" + |
673 | -// " \"eligibleAssets\": [],\n" + | 673 | + " \"eligibleAssets\": [],\n" + |
674 | -// " \"id\": \"000003586\",\n" + | 674 | + " \"id\": \"000003586\",\n" + |
675 | -// " \"loyaltyCampaignId\": \"NA\",\n" + | 675 | + " \"loyaltyCampaignId\": \"NA\",\n" + |
676 | -// " \"offerAudienceLevel\": \"guid\",\n" + | 676 | + " \"offerAudienceLevel\": \"guid\",\n" + |
677 | -// " \"offerCode1\": \"000003586\",\n" + | 677 | + " \"offerCode1\": \"000003586\",\n" + |
678 | -// " \"offerName\": \"CCMS loyalty offer 6\",\n" + | 678 | + " \"offerName\": \"CCMS loyalty offer 6\",\n" + |
679 | -// " \"productType\": \"GENERIC\",\n" + | 679 | + " \"productType\": \"GENERIC\",\n" + |
680 | -// " \"score\": \"50\",\n" + | 680 | + " \"score\": \"50\",\n" + |
681 | -// " \"treatmentCode\": \"5154.e03.ffffffffeebc476a.ffffffffc5b96f6a\",\n" + | 681 | + " \"treatmentCode\": \"5154.e03.ffffffffeebc476a.ffffffffc5b96f6a\",\n" + |
682 | -// " \"validity\": \"0\",\n" + | 682 | + " \"validity\": \"0\",\n" + |
683 | -// " \"zone\": \"COSMOTE_APP_LOYALTY_PROMO\"\n" + | 683 | + " \"zone\": \"COSMOTE_APP_LOYALTY_PROMO\"\n" + |
684 | -// " },\n" + | 684 | + " },\n" + |
685 | -// " {\n" + | 685 | + " {\n" + |
686 | -// " \"UACIOfferTrackingCode\": \"51d2.e0c.291f49d9.40d5a689\",\n" + | 686 | + " \"UACIOfferTrackingCode\": \"51d2.e0c.291f49d9.40d5a689\",\n" + |
687 | -// " \"businessAdditionalId\": \"\",\n" + | 687 | + " \"businessAdditionalId\": \"\",\n" + |
688 | -// " \"eligibleAssets\": [],\n" + | 688 | + " \"eligibleAssets\": [],\n" + |
689 | -// " \"id\": \"000003595\",\n" + | 689 | + " \"id\": \"000003595\",\n" + |
690 | -// " \"loyaltyCampaignId\": \"c5cc5f4f65624f47a580b720233fa60d\",\n" + | 690 | + " \"loyaltyCampaignId\": \"c5cc5f4f65624f47a580b720233fa60d\",\n" + |
691 | -// " \"offerAudienceLevel\": \"guid\",\n" + | 691 | + " \"offerAudienceLevel\": \"guid\",\n" + |
692 | -// " \"offerCode1\": \"000003595\",\n" + | 692 | + " \"offerCode1\": \"000003595\",\n" + |
693 | -// " \"offerName\": \"CCMS Loyal offer campaignId\",\n" + | 693 | + " \"offerName\": \"CCMS Loyal offer campaignId\",\n" + |
694 | -// " \"productType\": \"GENERIC\",\n" + | 694 | + " \"productType\": \"GENERIC\",\n" + |
695 | -// " \"score\": \"50\",\n" + | 695 | + " \"score\": \"50\",\n" + |
696 | -// " \"treatmentCode\": \"51d2.e0c.291f49d9.40d5a689\",\n" + | 696 | + " \"treatmentCode\": \"51d2.e0c.291f49d9.40d5a689\",\n" + |
697 | -// " \"validity\": \"0\",\n" + | 697 | + " \"validity\": \"0\",\n" + |
698 | -// " \"zone\": \"COSMOTE_APP_LOYALTY_PROMO\"\n" + | 698 | + " \"zone\": \"COSMOTE_APP_LOYALTY_PROMO\"\n" + |
699 | -// " },\n" + | 699 | + " },\n" + |
700 | -// " {\n" + | 700 | + " {\n" + |
701 | -// " \"UACIOfferTrackingCode\": \"51d6.e0c.291f49d9.40d5a689\",\n" + | 701 | + " \"UACIOfferTrackingCode\": \"51d6.e0c.291f49d9.40d5a689\",\n" + |
702 | -// " \"businessAdditionalId\": \"\",\n" + | 702 | + " \"businessAdditionalId\": \"\",\n" + |
703 | -// " \"eligibleAssets\": [],\n" + | 703 | + " \"eligibleAssets\": [],\n" + |
704 | -// " \"id\": \"000003595\",\n" + | 704 | + " \"id\": \"000003595\",\n" + |
705 | -// " \"loyaltyCampaignId\": \"c5cc5f4f65624f47a580b720233fa60d\",\n" + | 705 | + " \"loyaltyCampaignId\": \"c5cc5f4f65624f47a580b720233fa60d\",\n" + |
706 | -// " \"offerAudienceLevel\": \"guid\",\n" + | 706 | + " \"offerAudienceLevel\": \"guid\",\n" + |
707 | -// " \"offerCode1\": \"000003595\",\n" + | 707 | + " \"offerCode1\": \"000003595\",\n" + |
708 | -// " \"offerName\": \"CCMS Loyal offer campaignId\",\n" + | 708 | + " \"offerName\": \"CCMS Loyal offer campaignId\",\n" + |
709 | -// " \"productType\": \"GENERIC\",\n" + | 709 | + " \"productType\": \"GENERIC\",\n" + |
710 | -// " \"score\": \"50\",\n" + | 710 | + " \"score\": \"50\",\n" + |
711 | -// " \"treatmentCode\": \"51d6.e0c.291f49d9.40d5a689\",\n" + | 711 | + " \"treatmentCode\": \"51d6.e0c.291f49d9.40d5a689\",\n" + |
712 | -// " \"validity\": \"0\",\n" + | 712 | + " \"validity\": \"0\",\n" + |
713 | -// " \"zone\": \"COSMOTE_APP_GIFTS4U\"\n" + | 713 | + " \"zone\": \"COSMOTE_APP_GIFTS4U\"\n" + |
714 | -// " },\n" + | 714 | + " },\n" + |
715 | -// " {\n" + | 715 | + " {\n" + |
716 | -// " \"UACIOfferTrackingCode\": \"5150.e03.ffffffffeebc476a.ffffffffc5b96f6a\",\n" + | 716 | + " \"UACIOfferTrackingCode\": \"5150.e03.ffffffffeebc476a.ffffffffc5b96f6a\",\n" + |
717 | -// " \"businessAdditionalId\": \"\",\n" + | 717 | + " \"businessAdditionalId\": \"\",\n" + |
718 | -// " \"eligibleAssets\": [],\n" + | 718 | + " \"eligibleAssets\": [],\n" + |
719 | -// " \"id\": \"000003586\",\n" + | 719 | + " \"id\": \"000003586\",\n" + |
720 | -// " \"loyaltyCampaignId\": \"NA\",\n" + | 720 | + " \"loyaltyCampaignId\": \"NA\",\n" + |
721 | -// " \"offerAudienceLevel\": \"guid\",\n" + | 721 | + " \"offerAudienceLevel\": \"guid\",\n" + |
722 | -// " \"offerCode1\": \"000003586\",\n" + | 722 | + " \"offerCode1\": \"000003586\",\n" + |
723 | -// " \"offerName\": \"CCMS loyalty offer 6\",\n" + | 723 | + " \"offerName\": \"CCMS loyalty offer 6\",\n" + |
724 | -// " \"productType\": \"GENERIC\",\n" + | 724 | + " \"productType\": \"GENERIC\",\n" + |
725 | -// " \"score\": \"50\",\n" + | 725 | + " \"score\": \"50\",\n" + |
726 | -// " \"treatmentCode\": \"5150.e03.ffffffffeebc476a.ffffffffc5b96f6a\",\n" + | 726 | + " \"treatmentCode\": \"5150.e03.ffffffffeebc476a.ffffffffc5b96f6a\",\n" + |
727 | -// " \"validity\": \"0\",\n" + | 727 | + " \"validity\": \"0\",\n" + |
728 | -// " \"zone\": \"COSMOTE_APP_GIFTS4U\"\n" + | 728 | + " \"zone\": \"COSMOTE_APP_GIFTS4U\"\n" + |
729 | -// " },\n" + | 729 | + " },\n" + |
730 | -// " {\n" + | 730 | + " {\n" + |
731 | -// " \"UACIOfferTrackingCode\": \"5152.e03.ffffffffeebc476a.ffffffffc5b96f6a\",\n" + | 731 | + " \"UACIOfferTrackingCode\": \"5152.e03.ffffffffeebc476a.ffffffffc5b96f6a\",\n" + |
732 | -// " \"businessAdditionalId\": \"\",\n" + | 732 | + " \"businessAdditionalId\": \"\",\n" + |
733 | -// " \"eligibleAssets\": [],\n" + | 733 | + " \"eligibleAssets\": [],\n" + |
734 | -// " \"id\": \"000003586\",\n" + | 734 | + " \"id\": \"000003586\",\n" + |
735 | -// " \"loyaltyCampaignId\": \"NA\",\n" + | 735 | + " \"loyaltyCampaignId\": \"NA\",\n" + |
736 | -// " \"offerAudienceLevel\": \"guid\",\n" + | 736 | + " \"offerAudienceLevel\": \"guid\",\n" + |
737 | -// " \"offerCode1\": \"000003586\",\n" + | 737 | + " \"offerCode1\": \"000003586\",\n" + |
738 | -// " \"offerName\": \"CCMS loyalty offer 6\",\n" + | 738 | + " \"offerName\": \"CCMS loyalty offer 6\",\n" + |
739 | -// " \"productType\": \"GENERIC\",\n" + | 739 | + " \"productType\": \"GENERIC\",\n" + |
740 | -// " \"score\": \"50\",\n" + | 740 | + " \"score\": \"50\",\n" + |
741 | -// " \"treatmentCode\": \"5152.e03.ffffffffeebc476a.ffffffffc5b96f6a\",\n" + | 741 | + " \"treatmentCode\": \"5152.e03.ffffffffeebc476a.ffffffffc5b96f6a\",\n" + |
742 | -// " \"validity\": \"0\",\n" + | 742 | + " \"validity\": \"0\",\n" + |
743 | -// " \"zone\": \"COSMOTE_APP_MORE4U\"\n" + | 743 | + " \"zone\": \"COSMOTE_APP_MORE4U\"\n" + |
744 | -// " },\n" + | 744 | + " },\n" + |
745 | -// " {\n" + | 745 | + " {\n" + |
746 | -// " \"UACIOfferTrackingCode\": \"51d4.e0c.291f49d9.40d5a689\",\n" + | 746 | + " \"UACIOfferTrackingCode\": \"51d4.e0c.291f49d9.40d5a689\",\n" + |
747 | -// " \"businessAdditionalId\": \"\",\n" + | 747 | + " \"businessAdditionalId\": \"\",\n" + |
748 | -// " \"eligibleAssets\": [],\n" + | 748 | + " \"eligibleAssets\": [],\n" + |
749 | -// " \"id\": \"000003595\",\n" + | 749 | + " \"id\": \"000003595\",\n" + |
750 | -// " \"loyaltyCampaignId\": \"c5cc5f4f65624f47a580b720233fa60d\",\n" + | 750 | + " \"loyaltyCampaignId\": \"c5cc5f4f65624f47a580b720233fa60d\",\n" + |
751 | -// " \"offerAudienceLevel\": \"guid\",\n" + | 751 | + " \"offerAudienceLevel\": \"guid\",\n" + |
752 | -// " \"offerCode1\": \"000003595\",\n" + | 752 | + " \"offerCode1\": \"000003595\",\n" + |
753 | -// " \"offerName\": \"CCMS Loyal offer campaignId\",\n" + | 753 | + " \"offerName\": \"CCMS Loyal offer campaignId\",\n" + |
754 | -// " \"productType\": \"GENERIC\",\n" + | 754 | + " \"productType\": \"GENERIC\",\n" + |
755 | -// " \"score\": \"50\",\n" + | 755 | + " \"score\": \"50\",\n" + |
756 | -// " \"treatmentCode\": \"51d4.e0c.291f49d9.40d5a689\",\n" + | 756 | + " \"treatmentCode\": \"51d4.e0c.291f49d9.40d5a689\",\n" + |
757 | -// " \"validity\": \"0\",\n" + | 757 | + " \"validity\": \"0\",\n" + |
758 | -// " \"zone\": \"COSMOTE_APP_MORE4U\"\n" + | 758 | + " \"zone\": \"COSMOTE_APP_MORE4U\"\n" + |
759 | -// " }\n" + | 759 | + " }\n" + |
760 | -// " ]"); | 760 | + " ]"); |
761 | -// } catch (JSONException e) { | 761 | + } catch (JSONException e) { |
762 | -// e.printStackTrace(); | 762 | + e.printStackTrace(); |
763 | -// } | 763 | + } |
764 | -// if (jArray != null && jArray.length() > 0) { | 764 | + if (jArray != null && jArray.length() > 0) { |
765 | -// for (int i = 0; i < jArray.length(); i++) { | 765 | + for (int i = 0; i < jArray.length(); i++) { |
766 | -// JSONObject jobj = new JSONObject(); | 766 | + JSONObject jobj = new JSONObject(); |
767 | -// jobj = jArray.optJSONObject(i); | 767 | + jobj = jArray.optJSONObject(i); |
768 | -// if (jobj != null) { | 768 | + if (jobj != null) { |
769 | -// LoyaltyContextualOfferModel model = new LoyaltyContextualOfferModel(jobj); | 769 | + LoyaltyContextualOfferModel model = new LoyaltyContextualOfferModel(jobj); |
770 | -// list.add(model); | 770 | + list.add(model); |
771 | -// } | 771 | + } |
772 | -// } | 772 | + } |
773 | -// } | 773 | + } |
774 | -// WarplyManagerHelper.setCCMSLoyaltyCampaigns(list); | 774 | + WarplyManagerHelper.setCCMSLoyaltyCampaigns(list); |
775 | if (result.size() >= 0) { | 775 | if (result.size() >= 0) { |
776 | objectSerializer.serialize(result, File.separator + requestSignature); | 776 | objectSerializer.serialize(result, File.separator + requestSignature); |
777 | warplyPreferences.saveInboxLastCachedTimeStamp(requestSignature, System.currentTimeMillis()); | 777 | warplyPreferences.saveInboxLastCachedTimeStamp(requestSignature, System.currentTimeMillis()); | ... | ... |
... | @@ -67,7 +67,8 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation | ... | @@ -67,7 +67,8 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation |
67 | 67 | ||
68 | new Thread(() -> { | 68 | new Thread(() -> { |
69 | if (!Thread.currentThread().isInterrupted()) { | 69 | if (!Thread.currentThread().isInterrupted()) { |
70 | - WarplyManager.getConsumer(new WarplyConsumerRequest(), mConsumerReceiver); | 70 | +// WarplyManager.getConsumer(new WarplyConsumerRequest(), mConsumerReceiver); |
71 | + Warply.getInbox(new WarplyInboxRequest().setUseCache(false), mInboxReceiver); | ||
71 | } | 72 | } |
72 | }).start(); | 73 | }).start(); |
73 | } | 74 | } |
... | @@ -161,20 +162,20 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation | ... | @@ -161,20 +162,20 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation |
161 | // Inner and Anonymous Classes | 162 | // Inner and Anonymous Classes |
162 | // =========================================================== | 163 | // =========================================================== |
163 | 164 | ||
164 | - private final CallbackReceiver<Consumer> mConsumerReceiver = new CallbackReceiver<Consumer>() { | 165 | +// private final CallbackReceiver<Consumer> mConsumerReceiver = new CallbackReceiver<Consumer>() { |
165 | - @Override | 166 | +// @Override |
166 | - public void onSuccess(Consumer result) { | 167 | +// public void onSuccess(Consumer result) { |
167 | - mConsumer = result; | 168 | +// mConsumer = result; |
168 | - WarplyManagerHelper.setConsumer(result); | 169 | +//// WarplyManagerHelper.setConsumer(result); |
170 | +//// Thread.currentThread().interrupt(); | ||
171 | +// Warply.getInbox(new WarplyInboxRequest().setUseCache(false), mInboxReceiver); | ||
172 | +// } | ||
173 | +// | ||
174 | +// @Override | ||
175 | +// public void onFailure(int errorCode) { | ||
169 | // Thread.currentThread().interrupt(); | 176 | // Thread.currentThread().interrupt(); |
170 | - Warply.getInbox(new WarplyInboxRequest().setUseCache(false), mInboxReceiver); | 177 | +// } |
171 | - } | 178 | +// }; |
172 | - | ||
173 | - @Override | ||
174 | - public void onFailure(int errorCode) { | ||
175 | - Thread.currentThread().interrupt(); | ||
176 | - } | ||
177 | - }; | ||
178 | 179 | ||
179 | private final CallbackReceiver<CampaignList> mInboxReceiver = new CallbackReceiver<CampaignList>() { | 180 | private final CallbackReceiver<CampaignList> mInboxReceiver = new CallbackReceiver<CampaignList>() { |
180 | @Override | 181 | @Override | ... | ... |
... | @@ -215,11 +215,11 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene | ... | @@ -215,11 +215,11 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene |
215 | 215 | ||
216 | private void filterItems() { | 216 | private void filterItems() { |
217 | ArrayList<Campaign> gfyList = new ArrayList<>(); | 217 | ArrayList<Campaign> gfyList = new ArrayList<>(); |
218 | - if (WarplyManagerHelper.getCampaignList() != null && WarplyManagerHelper.getCampaignList().size() > 0) { | 218 | + if (WarplyManagerHelper.getCampaignListAll() != null && WarplyManagerHelper.getCampaignListAll().size() > 0) { |
219 | - Log.v("Got L:{" + String.valueOf(WarplyManagerHelper.getCampaignList().size()) + "}", " LOYALTY campaigns"); | 219 | + Log.v("Got L:{" + String.valueOf(WarplyManagerHelper.getCampaignListAll().size()) + "}", " LOYALTY campaigns"); |
220 | if (WarplyManagerHelper.getCCMSLoyaltyCampaigns() == null || WarplyManagerHelper.getCCMSLoyaltyCampaigns().size() == 0) { | 220 | if (WarplyManagerHelper.getCCMSLoyaltyCampaigns() == null || WarplyManagerHelper.getCCMSLoyaltyCampaigns().size() == 0) { |
221 | Log.v("Got C:{0}", " CCMS campaigns"); | 221 | Log.v("Got C:{0}", " CCMS campaigns"); |
222 | - for (Campaign camp : WarplyManagerHelper.getCampaignList()) { | 222 | + for (Campaign camp : WarplyManagerHelper.getCampaignListAll()) { |
223 | if (camp.getOfferCategory().equals("gifts_for_you")) { | 223 | if (camp.getOfferCategory().equals("gifts_for_you")) { |
224 | try { | 224 | try { |
225 | JSONObject extraFields = WarpJSONParser.getJSONFromString(camp.getExtraFields()); | 225 | JSONObject extraFields = WarpJSONParser.getJSONFromString(camp.getExtraFields()); |
... | @@ -236,7 +236,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene | ... | @@ -236,7 +236,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene |
236 | } else { | 236 | } else { |
237 | int ccmsCount = 0; | 237 | int ccmsCount = 0; |
238 | Log.v("Got C:{" + String.valueOf(WarplyManagerHelper.getCCMSLoyaltyCampaigns().size()) + "}", " CCMS campaigns"); | 238 | Log.v("Got C:{" + String.valueOf(WarplyManagerHelper.getCCMSLoyaltyCampaigns().size()) + "}", " CCMS campaigns"); |
239 | - for (Campaign camp : WarplyManagerHelper.getCampaignList()) { | 239 | + for (Campaign camp : WarplyManagerHelper.getCampaignListAll()) { |
240 | if (camp.getOfferCategory().equals("gifts_for_you")) { | 240 | if (camp.getOfferCategory().equals("gifts_for_you")) { |
241 | try { | 241 | try { |
242 | JSONObject extraFields = WarpJSONParser.getJSONFromString(camp.getExtraFields()); | 242 | JSONObject extraFields = WarpJSONParser.getJSONFromString(camp.getExtraFields()); | ... | ... |
... | @@ -19,21 +19,14 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy; | ... | @@ -19,21 +19,14 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy; |
19 | import org.greenrobot.eventbus.EventBus; | 19 | import org.greenrobot.eventbus.EventBus; |
20 | 20 | ||
21 | import java.io.Serializable; | 21 | import java.io.Serializable; |
22 | -import java.text.ParseException; | ||
23 | -import java.text.SimpleDateFormat; | ||
24 | import java.util.Collections; | 22 | import java.util.Collections; |
25 | import java.util.Comparator; | 23 | import java.util.Comparator; |
26 | -import java.util.Date; | ||
27 | -import java.util.concurrent.TimeUnit; | ||
28 | 24 | ||
29 | import ly.warp.sdk.R; | 25 | import ly.warp.sdk.R; |
30 | import ly.warp.sdk.io.models.ActiveDFYCouponEventModel; | 26 | import ly.warp.sdk.io.models.ActiveDFYCouponEventModel; |
31 | import ly.warp.sdk.io.models.ActiveDFYCouponModel; | 27 | import ly.warp.sdk.io.models.ActiveDFYCouponModel; |
32 | -import ly.warp.sdk.io.models.Coupon; | ||
33 | -import ly.warp.sdk.io.models.CouponList; | ||
34 | -import ly.warp.sdk.io.models.Couponset; | ||
35 | -import ly.warp.sdk.io.models.CouponsetsList; | ||
36 | import ly.warp.sdk.io.models.WarplyDealsAnalysisEventModel; | 28 | import ly.warp.sdk.io.models.WarplyDealsAnalysisEventModel; |
29 | +import ly.warp.sdk.utils.WarpUtils; | ||
37 | import ly.warp.sdk.utils.WarplyManagerHelper; | 30 | import ly.warp.sdk.utils.WarplyManagerHelper; |
38 | import ly.warp.sdk.utils.managers.WarplyEventBusManager; | 31 | import ly.warp.sdk.utils.managers.WarplyEventBusManager; |
39 | import ly.warp.sdk.views.adapters.ActiveCouponAdapter; | 32 | import ly.warp.sdk.views.adapters.ActiveCouponAdapter; |
... | @@ -164,23 +157,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { | ... | @@ -164,23 +157,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { |
164 | // =========================================================== | 157 | // =========================================================== |
165 | 158 | ||
166 | private void initViews() { | 159 | private void initViews() { |
167 | - CouponList mCouponList = new CouponList(); | 160 | + if (WarplyManagerHelper.getCouponList() != null) { |
168 | - CouponList mCouponListInitial = new CouponList(); | ||
169 | - mCouponListInitial.addAll(WarplyManagerHelper.getCouponList()); | ||
170 | - CouponsetsList mCouponsetListInitial = new CouponsetsList(); | ||
171 | - mCouponsetListInitial.addAll(WarplyManagerHelper.getCouponsets()); | ||
172 | - for (Coupon coupon : mCouponListInitial) { | ||
173 | - for (Couponset couponset : mCouponsetListInitial) { | ||
174 | - if (coupon.getCouponsetUuid().equals(couponset.getUuid())) { | ||
175 | - coupon.setDescription(couponset.getShortDescription()); | ||
176 | - coupon.setImage(couponset.getImgPreview()); | ||
177 | - coupon.setName(couponset.getName()); | ||
178 | - mCouponList.add(coupon); | ||
179 | - } | ||
180 | - } | ||
181 | - } | ||
182 | - | ||
183 | - if (mCouponList != null) { | ||
184 | mAdapterCoupons = new ActiveCouponAdapter(this, WarplyManagerHelper.getCouponList()); | 161 | mAdapterCoupons = new ActiveCouponAdapter(this, WarplyManagerHelper.getCouponList()); |
185 | mRecyclerCoupons.setAdapter(mAdapterCoupons); | 162 | mRecyclerCoupons.setAdapter(mAdapterCoupons); |
186 | mAdapterCoupons.getPositionClicks() | 163 | mAdapterCoupons.getPositionClicks() |
... | @@ -194,6 +171,11 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { | ... | @@ -194,6 +171,11 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { |
194 | .subscribe(); | 171 | .subscribe(); |
195 | } | 172 | } |
196 | 173 | ||
174 | + if (WarplyManagerHelper.getLoyaltyBadge() != null) { | ||
175 | + WarpUtils.log("LOYALTY_BADGE_COUNT: " + String.valueOf(WarplyManagerHelper.getLoyaltyBadge().getCouponCount())); | ||
176 | + WarpUtils.log("LOYALTY_BADGE_SUM: " + String.valueOf(WarplyManagerHelper.getLoyaltyBadge().getValue())); | ||
177 | + } | ||
178 | + | ||
197 | mTvGiftsValue.setText(String.format(getString(R.string.cos_value), String.valueOf(WarplyManagerHelper.getLoyaltyBadge().getValue()))); | 179 | mTvGiftsValue.setText(String.format(getString(R.string.cos_value), String.valueOf(WarplyManagerHelper.getLoyaltyBadge().getValue()))); |
198 | mTvGiftsValueAll.setText(String.format(getString(R.string.cos_deals_win_title), String.valueOf(WarplyManagerHelper.getLoyaltyBadge().getValue()), String.valueOf(WarplyManagerHelper.getLoyaltyBadge().getCouponCount()))); | 180 | mTvGiftsValueAll.setText(String.format(getString(R.string.cos_deals_win_title), String.valueOf(WarplyManagerHelper.getLoyaltyBadge().getValue()), String.valueOf(WarplyManagerHelper.getLoyaltyBadge().getCouponCount()))); |
199 | mTvDealsValue.setText(String.format(getString(R.string.cos_value), String.valueOf(/*couponDfyValue*/ WarplyManagerHelper.getDealsCouponsSum()))); | 181 | mTvDealsValue.setText(String.format(getString(R.string.cos_value), String.valueOf(/*couponDfyValue*/ WarplyManagerHelper.getDealsCouponsSum()))); | ... | ... |
... | @@ -139,11 +139,11 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener | ... | @@ -139,11 +139,11 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener |
139 | 139 | ||
140 | private void filterItems() { | 140 | private void filterItems() { |
141 | ArrayList<Campaign> gfyList = new ArrayList<>(); | 141 | ArrayList<Campaign> gfyList = new ArrayList<>(); |
142 | - if (WarplyManagerHelper.getCampaignList() != null && WarplyManagerHelper.getCampaignList().size() > 0) { | 142 | + if (WarplyManagerHelper.getCampaignListAll() != null && WarplyManagerHelper.getCampaignListAll().size() > 0) { |
143 | - Log.v("Got L:{" + String.valueOf(WarplyManagerHelper.getCampaignList().size()) + "}", " LOYALTY campaigns"); | 143 | + Log.v("Got L:{" + String.valueOf(WarplyManagerHelper.getCampaignListAll().size()) + "}", " LOYALTY campaigns"); |
144 | if (WarplyManagerHelper.getCCMSLoyaltyCampaigns() == null || WarplyManagerHelper.getCCMSLoyaltyCampaigns().size() == 0) { | 144 | if (WarplyManagerHelper.getCCMSLoyaltyCampaigns() == null || WarplyManagerHelper.getCCMSLoyaltyCampaigns().size() == 0) { |
145 | Log.v("Got C:{0}", " CCMS campaigns"); | 145 | Log.v("Got C:{0}", " CCMS campaigns"); |
146 | - for (Campaign camp : WarplyManagerHelper.getCampaignList()) { | 146 | + for (Campaign camp : WarplyManagerHelper.getCampaignListAll()) { |
147 | if (camp.getOfferCategory().equals("more_for_you")) { | 147 | if (camp.getOfferCategory().equals("more_for_you")) { |
148 | try { | 148 | try { |
149 | JSONObject extraFields = WarpJSONParser.getJSONFromString(camp.getExtraFields()); | 149 | JSONObject extraFields = WarpJSONParser.getJSONFromString(camp.getExtraFields()); |
... | @@ -160,7 +160,7 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener | ... | @@ -160,7 +160,7 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener |
160 | } else { | 160 | } else { |
161 | int ccmsCount = 0; | 161 | int ccmsCount = 0; |
162 | Log.v("Got C:{" + String.valueOf(WarplyManagerHelper.getCCMSLoyaltyCampaigns().size()) + "}", " CCMS campaigns"); | 162 | Log.v("Got C:{" + String.valueOf(WarplyManagerHelper.getCCMSLoyaltyCampaigns().size()) + "}", " CCMS campaigns"); |
163 | - for (Campaign camp : WarplyManagerHelper.getCampaignList()) { | 163 | + for (Campaign camp : WarplyManagerHelper.getCampaignListAll()) { |
164 | if (camp.getOfferCategory().equals("more_for_you")) { | 164 | if (camp.getOfferCategory().equals("more_for_you")) { |
165 | try { | 165 | try { |
166 | JSONObject extraFields = WarpJSONParser.getJSONFromString(camp.getExtraFields()); | 166 | JSONObject extraFields = WarpJSONParser.getJSONFromString(camp.getExtraFields()); | ... | ... |
... | @@ -127,8 +127,8 @@ public class WarpViewActivity extends WarpBaseActivity { | ... | @@ -127,8 +127,8 @@ public class WarpViewActivity extends WarpBaseActivity { |
127 | setResult(RESULT_OK, new Intent()); | 127 | setResult(RESULT_OK, new Intent()); |
128 | finish(); | 128 | finish(); |
129 | } | 129 | } |
130 | - if (event.getCoupon() != null) | 130 | +// if (event.getCoupon() != null) |
131 | - finish(); | 131 | +// finish(); |
132 | // if (event.getPacingCard() != null) | 132 | // if (event.getPacingCard() != null) |
133 | // finish(); | 133 | // finish(); |
134 | // if (event.getPacingService() != null) | 134 | // if (event.getPacingService() != null) | ... | ... |
... | @@ -32,12 +32,12 @@ package ly.warp.sdk.io.models; | ... | @@ -32,12 +32,12 @@ package ly.warp.sdk.io.models; |
32 | public class WarplyPacingEventModel { | 32 | public class WarplyPacingEventModel { |
33 | 33 | ||
34 | private boolean isVisible = false; | 34 | private boolean isVisible = false; |
35 | - private boolean isEnabled = false; | 35 | +// private boolean isEnabled = false; |
36 | 36 | ||
37 | 37 | ||
38 | public WarplyPacingEventModel() { | 38 | public WarplyPacingEventModel() { |
39 | this.isVisible = false; | 39 | this.isVisible = false; |
40 | - this.isEnabled = false; | 40 | +// this.isEnabled = false; |
41 | } | 41 | } |
42 | 42 | ||
43 | public boolean isVisible() { | 43 | public boolean isVisible() { |
... | @@ -48,11 +48,11 @@ public class WarplyPacingEventModel { | ... | @@ -48,11 +48,11 @@ public class WarplyPacingEventModel { |
48 | isVisible = visible; | 48 | isVisible = visible; |
49 | } | 49 | } |
50 | 50 | ||
51 | - public boolean isEnabled() { | 51 | +// public boolean isEnabled() { |
52 | - return isEnabled; | 52 | +// return isEnabled; |
53 | - } | 53 | +// } |
54 | - | 54 | +// |
55 | - public void setEnabled(boolean enabled) { | 55 | +// public void setEnabled(boolean enabled) { |
56 | - isEnabled = enabled; | 56 | +// isEnabled = enabled; |
57 | - } | 57 | +// } |
58 | } | 58 | } | ... | ... |
... | @@ -77,6 +77,7 @@ public class WarplyManagerHelper { | ... | @@ -77,6 +77,7 @@ public class WarplyManagerHelper { |
77 | private static CouponsetsList mCouponsetsList = new CouponsetsList(); | 77 | private static CouponsetsList mCouponsetsList = new CouponsetsList(); |
78 | private static CustomerStateModel mCustomerStateModel = new CustomerStateModel(); | 78 | private static CustomerStateModel mCustomerStateModel = new CustomerStateModel(); |
79 | private static CampaignList mCampaignList = new CampaignList(); | 79 | private static CampaignList mCampaignList = new CampaignList(); |
80 | + private static CampaignList mCampaignListAll = new CampaignList(); | ||
80 | private static ArrayList<ActiveDFYCouponModel> mDfyCoupons = new ArrayList(); | 81 | private static ArrayList<ActiveDFYCouponModel> mDfyCoupons = new ArrayList(); |
81 | private static ArrayList<LoyaltyGiftsForYouPackage> mSeasonalList = new ArrayList<>(); | 82 | private static ArrayList<LoyaltyGiftsForYouPackage> mSeasonalList = new ArrayList<>(); |
82 | private static ArrayList<LoyaltyContextualOfferModel> mCCMSList = new ArrayList<>(); | 83 | private static ArrayList<LoyaltyContextualOfferModel> mCCMSList = new ArrayList<>(); |
... | @@ -120,6 +121,7 @@ public class WarplyManagerHelper { | ... | @@ -120,6 +121,7 @@ public class WarplyManagerHelper { |
120 | * Handle sharing flow | 121 | * Handle sharing flow |
121 | */ | 122 | */ |
122 | public static void handleSharing(Context context, String sharingId) { | 123 | public static void handleSharing(Context context, String sharingId) { |
124 | + WarpUtils.log("SHARING_ID: " + sharingId); | ||
123 | WarplyManager.cosmoteSharing(new CosmoteSharingRequest().setSharingId(sharingId), new CallbackReceiver<JSONObject>() { | 125 | WarplyManager.cosmoteSharing(new CosmoteSharingRequest().setSharingId(sharingId), new CallbackReceiver<JSONObject>() { |
124 | @Override | 126 | @Override |
125 | public void onSuccess(JSONObject result) { | 127 | public void onSuccess(JSONObject result) { |
... | @@ -274,7 +276,7 @@ public class WarplyManagerHelper { | ... | @@ -274,7 +276,7 @@ public class WarplyManagerHelper { |
274 | public static String constructCcmsUrl(Campaign item, LoyaltyContextualOfferModel ccmsItem) { | 276 | public static String constructCcmsUrl(Campaign item, LoyaltyContextualOfferModel ccmsItem) { |
275 | Log.v("CCMS_PRESSED", ccmsItem.getId() + " " + ccmsItem.getOfferName()); | 277 | Log.v("CCMS_PRESSED", ccmsItem.getId() + " " + ccmsItem.getOfferName()); |
276 | item.setNew(false); | 278 | item.setNew(false); |
277 | - String tempAudienceLevel = ccmsItem.getEligibleAssets() != null && ccmsItem.getEligibleAssets().size() > 0 ? "MSISDN" : "GUID"; | 279 | +// String tempAudienceLevel = ccmsItem.getEligibleAssets() != null && ccmsItem.getEligibleAssets().size() > 0 ? "MSISDN" : "GUID"; |
278 | String assets = ""; | 280 | String assets = ""; |
279 | if (ccmsItem.getEligibleAssets() != null && ccmsItem.getEligibleAssets().size() > 0) { | 281 | if (ccmsItem.getEligibleAssets() != null && ccmsItem.getEligibleAssets().size() > 0) { |
280 | for (String singleAsset : ccmsItem.getEligibleAssets()) { | 282 | for (String singleAsset : ccmsItem.getEligibleAssets()) { |
... | @@ -313,7 +315,7 @@ public class WarplyManagerHelper { | ... | @@ -313,7 +315,7 @@ public class WarplyManagerHelper { |
313 | + "&WAVE=" + ccmsItem.getWave() | 315 | + "&WAVE=" + ccmsItem.getWave() |
314 | + "&VALIDITY=" + ccmsItem.getValidity() | 316 | + "&VALIDITY=" + ccmsItem.getValidity() |
315 | + "&TREATMENT_CODE=" + ccmsItem.getTreatmentCode() | 317 | + "&TREATMENT_CODE=" + ccmsItem.getTreatmentCode() |
316 | - + "&OfferAudienceLevel=" + tempAudienceLevel | 318 | + + "&OfferAudienceLevel=" + ccmsItem.getOfferAudienceLevel() |
317 | + "&ASSETS=" + assets | 319 | + "&ASSETS=" + assets |
318 | + "&ZONE=" + ccmsItem.getZone(); | 320 | + "&ZONE=" + ccmsItem.getZone(); |
319 | 321 | ||
... | @@ -339,7 +341,7 @@ public class WarplyManagerHelper { | ... | @@ -339,7 +341,7 @@ public class WarplyManagerHelper { |
339 | if (extraFields != null) { | 341 | if (extraFields != null) { |
340 | if (extraFields.has("ccms_offer") && extraFields.optString("ccms_offer").equals("true")) { | 342 | if (extraFields.has("ccms_offer") && extraFields.optString("ccms_offer").equals("true")) { |
341 | if (item.getLoyaltyCampaignId().equals(camp.getSessionUUID())) { | 343 | if (item.getLoyaltyCampaignId().equals(camp.getSessionUUID())) { |
342 | - String tempAudienceLevel = item.getEligibleAssets() != null && item.getEligibleAssets().size() > 0 ? "MSISDN" : "GUID"; | 344 | +// String tempAudienceLevel = item.getEligibleAssets() != null && item.getEligibleAssets().size() > 0 ? "MSISDN" : "GUID"; |
343 | String assets = ""; | 345 | String assets = ""; |
344 | if (item.getEligibleAssets() != null && item.getEligibleAssets().size() > 0) { | 346 | if (item.getEligibleAssets() != null && item.getEligibleAssets().size() > 0) { |
345 | for (String singleAsset : item.getEligibleAssets()) { | 347 | for (String singleAsset : item.getEligibleAssets()) { |
... | @@ -379,7 +381,7 @@ public class WarplyManagerHelper { | ... | @@ -379,7 +381,7 @@ public class WarplyManagerHelper { |
379 | + "&WAVE=" + item.getWave() | 381 | + "&WAVE=" + item.getWave() |
380 | + "&VALIDITY=" + item.getValidity() | 382 | + "&VALIDITY=" + item.getValidity() |
381 | + "&TREATMENT_CODE=" + item.getTreatmentCode() | 383 | + "&TREATMENT_CODE=" + item.getTreatmentCode() |
382 | - + "&OfferAudienceLevel=" + tempAudienceLevel | 384 | + + "&OfferAudienceLevel=" + item.getOfferAudienceLevel() |
383 | + "&ASSETS=" + assets | 385 | + "&ASSETS=" + assets |
384 | + "&ZONE=" + item.getZone(); | 386 | + "&ZONE=" + item.getZone(); |
385 | break; | 387 | break; |
... | @@ -518,7 +520,9 @@ public class WarplyManagerHelper { | ... | @@ -518,7 +520,9 @@ public class WarplyManagerHelper { |
518 | if (mCampaignList != null && mCampaignList.size() > 0) { | 520 | if (mCampaignList != null && mCampaignList.size() > 0) { |
519 | for (Campaign camp : mCampaignList) { | 521 | for (Campaign camp : mCampaignList) { |
520 | if (camp.getOfferCategory().equals("pacing")) { | 522 | if (camp.getOfferCategory().equals("pacing")) { |
521 | - return constructCampaignUrl(camp); | 523 | + String pacingUrl = constructCampaignUrl(camp); |
524 | + WarpUtils.log("PACING_LOG: " + pacingUrl); | ||
525 | + return pacingUrl; | ||
522 | } | 526 | } |
523 | } | 527 | } |
524 | } | 528 | } |
... | @@ -589,6 +593,11 @@ public class WarplyManagerHelper { | ... | @@ -589,6 +593,11 @@ public class WarplyManagerHelper { |
589 | } | 593 | } |
590 | 594 | ||
591 | public static CouponList getCouponList() { | 595 | public static CouponList getCouponList() { |
596 | + if (mCouponList != null && mCouponList.size() > 0) { | ||
597 | + WarpUtils.log("GET_COUPON_LIST size: " + String.valueOf(mCouponList.size())); | ||
598 | + } else { | ||
599 | + WarpUtils.log("GET_COUPON_LIST size: 0"); | ||
600 | + } | ||
592 | return mCouponList; | 601 | return mCouponList; |
593 | } | 602 | } |
594 | 603 | ||
... | @@ -617,14 +626,35 @@ public class WarplyManagerHelper { | ... | @@ -617,14 +626,35 @@ public class WarplyManagerHelper { |
617 | } | 626 | } |
618 | 627 | ||
619 | public static void setCampaignList(CampaignList campaignList) { | 628 | public static void setCampaignList(CampaignList campaignList) { |
629 | +// mCampaignList.clear(); | ||
630 | +// mCampaignList.addAll(campaignList); | ||
631 | + | ||
632 | + mCampaignListAll.clear(); | ||
633 | + mCampaignListAll.addAll(campaignList); | ||
634 | + | ||
620 | mCampaignList.clear(); | 635 | mCampaignList.clear(); |
621 | - mCampaignList.addAll(campaignList); | 636 | + for (Campaign camp : campaignList) { |
637 | + try { | ||
638 | + JSONObject extraFields = WarpJSONParser.getJSONFromString(camp.getExtraFields()); | ||
639 | + if (extraFields != null) { | ||
640 | + if (extraFields.length() == 0 || !extraFields.has("ccms_offer")) { | ||
641 | + mCampaignList.add(camp); | ||
642 | + } | ||
643 | + } | ||
644 | + } catch (Exception exception) { | ||
645 | + mCampaignList.add(camp); | ||
646 | + } | ||
647 | + } | ||
622 | } | 648 | } |
623 | 649 | ||
624 | public static CampaignList getCampaignList() { | 650 | public static CampaignList getCampaignList() { |
625 | return mCampaignList; | 651 | return mCampaignList; |
626 | } | 652 | } |
627 | 653 | ||
654 | + public static CampaignList getCampaignListAll() { | ||
655 | + return mCampaignListAll; | ||
656 | + } | ||
657 | + | ||
628 | public static void setCouponList(CouponList couponList) { | 658 | public static void setCouponList(CouponList couponList) { |
629 | LoyaltyBadgeModel badge = new LoyaltyBadgeModel(); | 659 | LoyaltyBadgeModel badge = new LoyaltyBadgeModel(); |
630 | CouponList cpnlist = new CouponList(); | 660 | CouponList cpnlist = new CouponList(); |
... | @@ -632,19 +662,13 @@ public class WarplyManagerHelper { | ... | @@ -632,19 +662,13 @@ public class WarplyManagerHelper { |
632 | int couponCount = 0; | 662 | int couponCount = 0; |
633 | for (Coupon coupon : couponList) { | 663 | for (Coupon coupon : couponList) { |
634 | if (coupon.getStatus() == 1) { | 664 | if (coupon.getStatus() == 1) { |
635 | - try { | ||
636 | - float tempCouponValue = Float.parseFloat(coupon.getDiscount()); | ||
637 | cpnlist.add(coupon); | 665 | cpnlist.add(coupon); |
638 | - } catch (NumberFormatException e) { | ||
639 | - cpnlist.remove(coupon); | ||
640 | - } | ||
641 | } else if (coupon.getStatus() == 0) { | 666 | } else if (coupon.getStatus() == 0) { |
642 | try { | 667 | try { |
643 | couponCount += 1; | 668 | couponCount += 1; |
644 | couponValue += Float.parseFloat(coupon.getDiscount()); | 669 | couponValue += Float.parseFloat(coupon.getDiscount()); |
645 | } catch (NumberFormatException e) { | 670 | } catch (NumberFormatException e) { |
646 | couponCount -= 1; | 671 | couponCount -= 1; |
647 | - cpnlist.remove(coupon); | ||
648 | } | 672 | } |
649 | } | 673 | } |
650 | } | 674 | } | ... | ... |
... | @@ -107,6 +107,7 @@ import ly.warp.sdk.io.request.WarplyUserCouponsRequest; | ... | @@ -107,6 +107,7 @@ import ly.warp.sdk.io.request.WarplyUserCouponsRequest; |
107 | import ly.warp.sdk.io.request.WarplyValidateCouponRequest; | 107 | import ly.warp.sdk.io.request.WarplyValidateCouponRequest; |
108 | import ly.warp.sdk.io.request.WarplyVerifyOTPRequest; | 108 | import ly.warp.sdk.io.request.WarplyVerifyOTPRequest; |
109 | import ly.warp.sdk.io.request.WarplyVerifyTicketRequest; | 109 | import ly.warp.sdk.io.request.WarplyVerifyTicketRequest; |
110 | +import ly.warp.sdk.utils.WarpJSONParser; | ||
110 | import ly.warp.sdk.utils.WarpUtils; | 111 | import ly.warp.sdk.utils.WarpUtils; |
111 | import ly.warp.sdk.utils.WarplyManagerHelper; | 112 | import ly.warp.sdk.utils.WarplyManagerHelper; |
112 | import ly.warp.sdk.utils.WarplyProperty; | 113 | import ly.warp.sdk.utils.WarplyProperty; |
... | @@ -778,6 +779,26 @@ public class WarplyManager { | ... | @@ -778,6 +779,26 @@ public class WarplyManager { |
778 | e.printStackTrace(); | 779 | e.printStackTrace(); |
779 | receiver.onFailure(2); | 780 | receiver.onFailure(2); |
780 | } | 781 | } |
782 | + | ||
783 | + getConsumer(new WarplyConsumerRequest(), new CallbackReceiver<Consumer>() { | ||
784 | + @Override | ||
785 | + public void onSuccess(Consumer result) { | ||
786 | + WarplyManagerHelper.setConsumer(result); | ||
787 | + if (result != null) { | ||
788 | + JSONObject profMetadata = WarpJSONParser.getJSONFromString(result.getProfileMetadata()); | ||
789 | + if (profMetadata != null) { | ||
790 | + if (profMetadata.has("badge")) { | ||
791 | + WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge")); | ||
792 | + } | ||
793 | + } | ||
794 | + } | ||
795 | + } | ||
796 | + | ||
797 | + @Override | ||
798 | + public void onFailure(int errorCode) { | ||
799 | + | ||
800 | + } | ||
801 | + }); | ||
781 | } else | 802 | } else |
782 | receiver.onFailure(2); | 803 | receiver.onFailure(2); |
783 | } else | 804 | } else |
... | @@ -799,19 +820,19 @@ public class WarplyManager { | ... | @@ -799,19 +820,19 @@ public class WarplyManager { |
799 | Warply.postReceiveMicroappData(WarpConstants.MICROAPP_COUPONS, true, "context", request.toJson(), new CouponsHook(new CallbackReceiver<CouponList>() { | 820 | Warply.postReceiveMicroappData(WarpConstants.MICROAPP_COUPONS, true, "context", request.toJson(), new CouponsHook(new CallbackReceiver<CouponList>() { |
800 | @Override | 821 | @Override |
801 | public void onSuccess(CouponList result) { | 822 | public void onSuccess(CouponList result) { |
802 | - CouponList mCouponList = new CouponList(); | 823 | +// CouponList mCouponList = new CouponList(); |
803 | - for (Coupon coupon : result) { | 824 | +// for (Coupon coupon : result) { |
804 | - for (Couponset couponset : WarplyManagerHelper.getCouponsets()) { | 825 | +// for (Couponset couponset : WarplyManagerHelper.getCouponsets()) { |
805 | - if (coupon.getCouponsetUuid().equals(couponset.getUuid())) { | 826 | +// if (coupon.getCouponsetUuid().equals(couponset.getUuid())) { |
806 | - coupon.setDescription(couponset.getShortDescription()); | 827 | +// coupon.setDescription(couponset.getShortDescription()); |
807 | - coupon.setImage(couponset.getImgPreview()); | 828 | +// coupon.setImage(couponset.getImgPreview()); |
808 | - coupon.setName(couponset.getName()); | 829 | +// coupon.setName(couponset.getName()); |
809 | - mCouponList.add(coupon); | 830 | +// mCouponList.add(coupon); |
810 | - } | 831 | +// } |
811 | - } | 832 | +// } |
812 | - } | 833 | +// } |
813 | - WarplyManagerHelper.setCouponList(mCouponList); | 834 | +// WarplyManagerHelper.setCouponList(mCouponList); |
814 | - receiver.onSuccess(mCouponList); | 835 | + receiver.onSuccess(/*mCouponList*/ result); |
815 | } | 836 | } |
816 | 837 | ||
817 | @Override | 838 | @Override |
... | @@ -1618,6 +1639,26 @@ public class WarplyManager { | ... | @@ -1618,6 +1639,26 @@ public class WarplyManager { |
1618 | e.printStackTrace(); | 1639 | e.printStackTrace(); |
1619 | receiver.onFailure(2); | 1640 | receiver.onFailure(2); |
1620 | } | 1641 | } |
1642 | + | ||
1643 | + getConsumer(new WarplyConsumerRequest(), new CallbackReceiver<Consumer>() { | ||
1644 | + @Override | ||
1645 | + public void onSuccess(Consumer result) { | ||
1646 | + WarplyManagerHelper.setConsumer(result); | ||
1647 | + if (result != null) { | ||
1648 | + JSONObject profMetadata = WarpJSONParser.getJSONFromString(result.getProfileMetadata()); | ||
1649 | + if (profMetadata != null) { | ||
1650 | + if (profMetadata.has("badge")) { | ||
1651 | + WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge")); | ||
1652 | + } | ||
1653 | + } | ||
1654 | + } | ||
1655 | + } | ||
1656 | + | ||
1657 | + @Override | ||
1658 | + public void onFailure(int errorCode) { | ||
1659 | + | ||
1660 | + } | ||
1661 | + }); | ||
1621 | } else | 1662 | } else |
1622 | receiver.onFailure(2); | 1663 | receiver.onFailure(2); |
1623 | } else | 1664 | } else | ... | ... |
... | @@ -396,8 +396,10 @@ public class WarpView extends WebView { | ... | @@ -396,8 +396,10 @@ public class WarpView extends WebView { |
396 | EventBus.getDefault().post(new WarplyEventBusManager(questionnaireEvent)); | 396 | EventBus.getDefault().post(new WarplyEventBusManager(questionnaireEvent)); |
397 | } | 397 | } |
398 | } else if (parts[1].equals("couponRetrieved")) { | 398 | } else if (parts[1].equals("couponRetrieved")) { |
399 | + EventBus.getDefault().post(new WarplyEventBusManager(new CouponEventModel())); | ||
400 | + } else if (parts[1].equals("couponShared")) { | ||
399 | // EventBus.getDefault().post(new WarplyEventBusManager(new CouponEventModel())); | 401 | // EventBus.getDefault().post(new WarplyEventBusManager(new CouponEventModel())); |
400 | - } else if (parts[2].equals("serviceDisabled")) { | 402 | + } /*else if (parts[2].equals("serviceDisabled")) { |
401 | // WorkManager.getInstance(Warply.getWarplyContext()).cancelAllWorkByTag(UpdateUserLocationService.TAG); | 403 | // WorkManager.getInstance(Warply.getWarplyContext()).cancelAllWorkByTag(UpdateUserLocationService.TAG); |
402 | WarplyPacingEventModel pacingService = new WarplyPacingEventModel(); | 404 | WarplyPacingEventModel pacingService = new WarplyPacingEventModel(); |
403 | pacingService.setEnabled(false); | 405 | pacingService.setEnabled(false); |
... | @@ -407,11 +409,11 @@ public class WarpView extends WebView { | ... | @@ -407,11 +409,11 @@ public class WarpView extends WebView { |
407 | WarplyPacingEventModel pacingService = new WarplyPacingEventModel(); | 409 | WarplyPacingEventModel pacingService = new WarplyPacingEventModel(); |
408 | pacingService.setEnabled(true); | 410 | pacingService.setEnabled(true); |
409 | EventBus.getDefault().post(new WarplyEventBusManager(pacingService)); | 411 | EventBus.getDefault().post(new WarplyEventBusManager(pacingService)); |
410 | - } else if (parts[2].equals("shortcutEnabled")) { | 412 | + }*/ else if (parts[1].equals("steps") && parts[2].equals("shortcutEnabled")) { |
411 | WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); | 413 | WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); |
412 | pacingVisible.setVisible(true); | 414 | pacingVisible.setVisible(true); |
413 | EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); | 415 | EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); |
414 | - } else if (parts[2].equals("shortcutDisabled")) { | 416 | + } else if (parts[1].equals("steps") && parts[2].equals("shortcutDisabled")) { |
415 | WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); | 417 | WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); |
416 | pacingVisible.setVisible(false); | 418 | pacingVisible.setVisible(false); |
417 | EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); | 419 | EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); | ... | ... |
... | @@ -129,7 +129,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte | ... | @@ -129,7 +129,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte |
129 | else | 129 | else |
130 | holder.tvCouponDate.setText(String.format(mContext.getString(R.string.cos_coupon_date), simpleDateFormat.format(newDate != null ? newDate : ""))); | 130 | holder.tvCouponDate.setText(String.format(mContext.getString(R.string.cos_coupon_date), simpleDateFormat.format(newDate != null ? newDate : ""))); |
131 | 131 | ||
132 | - holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.euro)); | 132 | + holder.tvCouponValue.setText(couponItem.getDiscount()); |
133 | holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem)); | 133 | holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem)); |
134 | } | 134 | } |
135 | } | 135 | } | ... | ... |
-
Please register or login to post a comment