Panagiotis Triantafyllou

neo tag implementation

...@@ -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-cosbeta74' 5 + PUBLISH_VERSION = '4.5.4-cosbeta75'
6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk' 6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
7 } 7 }
8 8
......
...@@ -1309,7 +1309,7 @@ public enum Warply { ...@@ -1309,7 +1309,7 @@ public enum Warply {
1309 isInitializedOrThrow(); 1309 isInitializedOrThrow();
1310 1310
1311 WarpUtils.log("************* WARPLY Microapp ********************"); 1311 WarpUtils.log("************* WARPLY Microapp ********************");
1312 - if (!WarplyServerPreferencesManager.isMicroAppActive(WarpConstants.MicroApp.APPLICATION_DATA)) { 1312 + if (!WarplyServerPreferencesManager.isMicroAppActive(WarpConstants.MicroApp.DEVICE_INFO)) {
1313 WarpUtils.log("[WARP Trace] Application Info Microapp is not active"); 1313 WarpUtils.log("[WARP Trace] Application Info Microapp is not active");
1314 return; 1314 return;
1315 } else { 1315 } else {
......
...@@ -13,6 +13,8 @@ import android.widget.TextView; ...@@ -13,6 +13,8 @@ import android.widget.TextView;
13 13
14 import androidx.recyclerview.widget.LinearLayoutManager; 14 import androidx.recyclerview.widget.LinearLayoutManager;
15 import androidx.recyclerview.widget.RecyclerView; 15 import androidx.recyclerview.widget.RecyclerView;
16 +import androidx.work.OneTimeWorkRequest;
17 +import androidx.work.WorkManager;
16 18
17 import org.greenrobot.eventbus.EventBus; 19 import org.greenrobot.eventbus.EventBus;
18 import org.greenrobot.eventbus.Subscribe; 20 import org.greenrobot.eventbus.Subscribe;
...@@ -31,6 +33,7 @@ import ly.warp.sdk.io.models.CampaignList; ...@@ -31,6 +33,7 @@ import ly.warp.sdk.io.models.CampaignList;
31 import ly.warp.sdk.io.models.LoyaltyContextualOfferModel; 33 import ly.warp.sdk.io.models.LoyaltyContextualOfferModel;
32 import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel; 34 import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel;
33 import ly.warp.sdk.io.models.MergedMore; 35 import ly.warp.sdk.io.models.MergedMore;
36 +import ly.warp.sdk.services.EventCampaignService;
34 import ly.warp.sdk.utils.WarpJSONParser; 37 import ly.warp.sdk.utils.WarpJSONParser;
35 import ly.warp.sdk.utils.WarpUtils; 38 import ly.warp.sdk.utils.WarpUtils;
36 import ly.warp.sdk.utils.WarplyManagerHelper; 39 import ly.warp.sdk.utils.WarplyManagerHelper;
...@@ -174,6 +177,14 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener ...@@ -174,6 +177,14 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener
174 super.attachBaseContext(ViewPumpContextWrapper.wrap(newBase)); 177 super.attachBaseContext(ViewPumpContextWrapper.wrap(newBase));
175 } 178 }
176 179
180 + @Override
181 + protected void onActivityResult(int requestCode, int resultCode, Intent data) {
182 + if (requestCode == 1003) {
183 + OneTimeWorkRequest mywork = new OneTimeWorkRequest.Builder(EventCampaignService.class).build();
184 + WorkManager.getInstance(MoreForYouActivity.this).enqueue(mywork);
185 + }
186 + }
187 +
177 @Subscribe() 188 @Subscribe()
178 public void onMessageEvent(WarplyEventBusManager event) { 189 public void onMessageEvent(WarplyEventBusManager event) {
179 if (event.getCcmsAdded() != null || event.getCampaignsAdded() != null) { 190 if (event.getCcmsAdded() != null || event.getCampaignsAdded() != null) {
...@@ -520,16 +531,16 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener ...@@ -520,16 +531,16 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener
520 for (LoyaltyContextualOfferModel ccms : WarplyManagerHelper.getCCMSLoyaltyCampaigns()) { 531 for (LoyaltyContextualOfferModel ccms : WarplyManagerHelper.getCCMSLoyaltyCampaigns()) {
521 if (ccms.getLoyaltyCampaignId().equals(moreItem.getSessionUUID())) { 532 if (ccms.getLoyaltyCampaignId().equals(moreItem.getSessionUUID())) {
522 WarpUtils.log("CCMS_CLICK " + ccms.toString()); 533 WarpUtils.log("CCMS_CLICK " + ccms.toString());
523 - startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCcmsUrl(moreItem, ccms))); 534 + startActivityForResult(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCcmsUrl(moreItem, ccms)), 1003);
524 break; 535 break;
525 } 536 }
526 } 537 }
527 } else { 538 } else {
528 - startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(moreItem))); 539 + startActivityForResult(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(moreItem)), 1003);
529 } 540 }
530 } 541 }
531 } catch (Exception exception) { 542 } catch (Exception exception) {
532 - startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(moreItem))); 543 + startActivityForResult(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(moreItem)), 1003);
533 } 544 }
534 } 545 }
535 546
......
...@@ -739,6 +739,7 @@ public class WarplyManagerHelper { ...@@ -739,6 +739,7 @@ public class WarplyManagerHelper {
739 } 739 }
740 } else if (extraFields.has("type") && extraFields.optString("type").equals("telco")) { 740 } else if (extraFields.has("type") && extraFields.optString("type").equals("telco")) {
741 if (item.getLoyaltyCampaignId().equals(camp.getSessionUUID())) { 741 if (item.getLoyaltyCampaignId().equals(camp.getSessionUUID())) {
742 + WarplyManager.getSingleCampaign(camp.getSessionUUID());
742 Intent intent = new Intent(context, TelcoActivity.class); 743 Intent intent = new Intent(context, TelcoActivity.class);
743 intent.putExtra("ccms", item); 744 intent.putExtra("ccms", item);
744 intent.putExtra("loyalty", (Serializable) camp); 745 intent.putExtra("loyalty", (Serializable) camp);
...@@ -775,6 +776,7 @@ public class WarplyManagerHelper { ...@@ -775,6 +776,7 @@ public class WarplyManagerHelper {
775 String cpnUuid = campaignSettings.optString("couponset"); 776 String cpnUuid = campaignSettings.optString("couponset");
776 for (Couponset cpns : WarplyManagerHelper.getCouponsets()) { 777 for (Couponset cpns : WarplyManagerHelper.getCouponsets()) {
777 if (cpns.getUuid().equals(cpnUuid)) { 778 if (cpns.getUuid().equals(cpnUuid)) {
779 + WarplyManager.getSingleCampaign(item.getSessionUUID());
778 Intent intent = new Intent(context, CouponsetInfoActivity.class); 780 Intent intent = new Intent(context, CouponsetInfoActivity.class);
779 intent.putExtra("couponset", (Serializable) cpns); 781 intent.putExtra("couponset", (Serializable) cpns);
780 intent.putExtra("loyalty", (Serializable) item); 782 intent.putExtra("loyalty", (Serializable) item);
...@@ -802,6 +804,7 @@ public class WarplyManagerHelper { ...@@ -802,6 +804,7 @@ public class WarplyManagerHelper {
802 String cpnUuid = campaignSettings.optString("couponset"); 804 String cpnUuid = campaignSettings.optString("couponset");
803 for (Couponset cpns : WarplyManagerHelper.getCouponsets()) { 805 for (Couponset cpns : WarplyManagerHelper.getCouponsets()) {
804 if (cpns.getUuid().equals(cpnUuid)) { 806 if (cpns.getUuid().equals(cpnUuid)) {
807 + WarplyManager.getSingleCampaign(item.getSessionUUID());
805 Intent intent = new Intent(context, CouponsetInfoActivity.class); 808 Intent intent = new Intent(context, CouponsetInfoActivity.class);
806 intent.putExtra("couponset", (Serializable) cpns); 809 intent.putExtra("couponset", (Serializable) cpns);
807 intent.putExtra("loyalty", (Serializable) item); 810 intent.putExtra("loyalty", (Serializable) item);
......
...@@ -31,6 +31,8 @@ import android.os.Looper; ...@@ -31,6 +31,8 @@ import android.os.Looper;
31 import android.util.Log; 31 import android.util.Log;
32 32
33 import androidx.appcompat.app.AlertDialog; 33 import androidx.appcompat.app.AlertDialog;
34 +import androidx.work.OneTimeWorkRequest;
35 +import androidx.work.WorkManager;
34 36
35 import org.greenrobot.eventbus.EventBus; 37 import org.greenrobot.eventbus.EventBus;
36 import org.json.JSONArray; 38 import org.json.JSONArray;
...@@ -133,6 +135,7 @@ import ly.warp.sdk.io.request.WarplyUserCouponsRequest; ...@@ -133,6 +135,7 @@ import ly.warp.sdk.io.request.WarplyUserCouponsRequest;
133 import ly.warp.sdk.io.request.WarplyValidateCouponRequest; 135 import ly.warp.sdk.io.request.WarplyValidateCouponRequest;
134 import ly.warp.sdk.io.request.WarplyVerifyOTPRequest; 136 import ly.warp.sdk.io.request.WarplyVerifyOTPRequest;
135 import ly.warp.sdk.io.request.WarplyVerifyTicketRequest; 137 import ly.warp.sdk.io.request.WarplyVerifyTicketRequest;
138 +import ly.warp.sdk.services.EventCampaignService;
136 import ly.warp.sdk.utils.WarpJSONParser; 139 import ly.warp.sdk.utils.WarpJSONParser;
137 import ly.warp.sdk.utils.WarpUtils; 140 import ly.warp.sdk.utils.WarpUtils;
138 import ly.warp.sdk.utils.WarplyManagerHelper; 141 import ly.warp.sdk.utils.WarplyManagerHelper;
...@@ -2577,19 +2580,41 @@ public class WarplyManager { ...@@ -2577,19 +2580,41 @@ public class WarplyManager {
2577 WarpUtils.log("[WARP Trace] WARPLY Get Event Request is active"); 2580 WarpUtils.log("[WARP Trace] WARPLY Get Event Request is active");
2578 WarpUtils.log("**************************************************"); 2581 WarpUtils.log("**************************************************");
2579 2582
2580 -// String url = WarplyProperty.getBaseUrl(Warply.getWarplyContext()) + WarpConstants.BASE_REMOTE_PAGE_URL + sessionUuid; 2583 + String url = WarplyProperty.getBaseUrl(Warply.getWarplyContext()) + WarpConstants.BASE_REMOTE_PAGE_URL + sessionUuid;
2581 -// 2584 +
2582 -// Warply.getSingleCampaign(null, url, 2585 + Warply.getSingleCampaign(null, url,
2583 -// new CallbackReceiver<JSONObject>() { 2586 + new CallbackReceiver<JSONObject>() {
2584 -// @Override 2587 + @Override
2585 -// public void onSuccess(JSONObject result) { 2588 + public void onSuccess(JSONObject result) {
2586 -// WarpUtils.log("GET_SINGLE_CAMPAIGN_SUCCESS"); 2589 + WarplyManager.getCampaigns(new WarplyGetCampaignsRequest().setLanguage("en"), new CallbackReceiver<CampaignList>() {
2587 -// } 2590 + @Override
2588 -// 2591 + public void onSuccess(CampaignList result) {
2589 -// @Override 2592 + OneTimeWorkRequest mywork = new OneTimeWorkRequest.Builder(EventCampaignService.class).build();
2590 -// public void onFailure(int errorCode) { 2593 + WorkManager.getInstance(Warply.getWarplyContext()).enqueue(mywork);
2591 -// WarpUtils.log("GET_SINGLE_CAMPAIGN_FAILED"); 2594 + }
2592 -// } 2595 +
2593 -// }, null); 2596 + @Override
2597 + public void onFailure(int errorCode) {
2598 +
2599 + }
2600 + });
2601 + }
2602 +
2603 + @Override
2604 + public void onFailure(int errorCode) {
2605 + WarplyManager.getCampaigns(new WarplyGetCampaignsRequest().setLanguage("en"), new CallbackReceiver<CampaignList>() {
2606 + @Override
2607 + public void onSuccess(CampaignList result) {
2608 + OneTimeWorkRequest mywork = new OneTimeWorkRequest.Builder(EventCampaignService.class).build();
2609 + WorkManager.getInstance(Warply.getWarplyContext()).enqueue(mywork);
2610 + }
2611 +
2612 + @Override
2613 + public void onFailure(int errorCode) {
2614 +
2615 + }
2616 + });
2617 + }
2618 + }, null);
2594 } 2619 }
2595 } 2620 }
......