Panagiotis Triantafyllou

neo tag implementation

......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4-cosbeta74'
PUBLISH_VERSION = '4.5.4-cosbeta75'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -1309,7 +1309,7 @@ public enum Warply {
isInitializedOrThrow();
WarpUtils.log("************* WARPLY Microapp ********************");
if (!WarplyServerPreferencesManager.isMicroAppActive(WarpConstants.MicroApp.APPLICATION_DATA)) {
if (!WarplyServerPreferencesManager.isMicroAppActive(WarpConstants.MicroApp.DEVICE_INFO)) {
WarpUtils.log("[WARP Trace] Application Info Microapp is not active");
return;
} else {
......
......@@ -13,6 +13,8 @@ import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.work.OneTimeWorkRequest;
import androidx.work.WorkManager;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
......@@ -31,6 +33,7 @@ import ly.warp.sdk.io.models.CampaignList;
import ly.warp.sdk.io.models.LoyaltyContextualOfferModel;
import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel;
import ly.warp.sdk.io.models.MergedMore;
import ly.warp.sdk.services.EventCampaignService;
import ly.warp.sdk.utils.WarpJSONParser;
import ly.warp.sdk.utils.WarpUtils;
import ly.warp.sdk.utils.WarplyManagerHelper;
......@@ -174,6 +177,14 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener
super.attachBaseContext(ViewPumpContextWrapper.wrap(newBase));
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == 1003) {
OneTimeWorkRequest mywork = new OneTimeWorkRequest.Builder(EventCampaignService.class).build();
WorkManager.getInstance(MoreForYouActivity.this).enqueue(mywork);
}
}
@Subscribe()
public void onMessageEvent(WarplyEventBusManager event) {
if (event.getCcmsAdded() != null || event.getCampaignsAdded() != null) {
......@@ -520,16 +531,16 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener
for (LoyaltyContextualOfferModel ccms : WarplyManagerHelper.getCCMSLoyaltyCampaigns()) {
if (ccms.getLoyaltyCampaignId().equals(moreItem.getSessionUUID())) {
WarpUtils.log("CCMS_CLICK " + ccms.toString());
startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCcmsUrl(moreItem, ccms)));
startActivityForResult(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCcmsUrl(moreItem, ccms)), 1003);
break;
}
}
} else {
startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(moreItem)));
startActivityForResult(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(moreItem)), 1003);
}
}
} catch (Exception exception) {
startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(moreItem)));
startActivityForResult(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(moreItem)), 1003);
}
}
......
......@@ -739,6 +739,7 @@ public class WarplyManagerHelper {
}
} else if (extraFields.has("type") && extraFields.optString("type").equals("telco")) {
if (item.getLoyaltyCampaignId().equals(camp.getSessionUUID())) {
WarplyManager.getSingleCampaign(camp.getSessionUUID());
Intent intent = new Intent(context, TelcoActivity.class);
intent.putExtra("ccms", item);
intent.putExtra("loyalty", (Serializable) camp);
......@@ -775,6 +776,7 @@ public class WarplyManagerHelper {
String cpnUuid = campaignSettings.optString("couponset");
for (Couponset cpns : WarplyManagerHelper.getCouponsets()) {
if (cpns.getUuid().equals(cpnUuid)) {
WarplyManager.getSingleCampaign(item.getSessionUUID());
Intent intent = new Intent(context, CouponsetInfoActivity.class);
intent.putExtra("couponset", (Serializable) cpns);
intent.putExtra("loyalty", (Serializable) item);
......@@ -802,6 +804,7 @@ public class WarplyManagerHelper {
String cpnUuid = campaignSettings.optString("couponset");
for (Couponset cpns : WarplyManagerHelper.getCouponsets()) {
if (cpns.getUuid().equals(cpnUuid)) {
WarplyManager.getSingleCampaign(item.getSessionUUID());
Intent intent = new Intent(context, CouponsetInfoActivity.class);
intent.putExtra("couponset", (Serializable) cpns);
intent.putExtra("loyalty", (Serializable) item);
......
......@@ -31,6 +31,8 @@ import android.os.Looper;
import android.util.Log;
import androidx.appcompat.app.AlertDialog;
import androidx.work.OneTimeWorkRequest;
import androidx.work.WorkManager;
import org.greenrobot.eventbus.EventBus;
import org.json.JSONArray;
......@@ -133,6 +135,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.services.EventCampaignService;
import ly.warp.sdk.utils.WarpJSONParser;
import ly.warp.sdk.utils.WarpUtils;
import ly.warp.sdk.utils.WarplyManagerHelper;
......@@ -2577,19 +2580,41 @@ public class WarplyManager {
WarpUtils.log("[WARP Trace] WARPLY Get Event Request is active");
WarpUtils.log("**************************************************");
// String url = WarplyProperty.getBaseUrl(Warply.getWarplyContext()) + WarpConstants.BASE_REMOTE_PAGE_URL + sessionUuid;
//
// Warply.getSingleCampaign(null, url,
// new CallbackReceiver<JSONObject>() {
// @Override
// public void onSuccess(JSONObject result) {
// WarpUtils.log("GET_SINGLE_CAMPAIGN_SUCCESS");
// }
//
// @Override
// public void onFailure(int errorCode) {
// WarpUtils.log("GET_SINGLE_CAMPAIGN_FAILED");
// }
// }, null);
String url = WarplyProperty.getBaseUrl(Warply.getWarplyContext()) + WarpConstants.BASE_REMOTE_PAGE_URL + sessionUuid;
Warply.getSingleCampaign(null, url,
new CallbackReceiver<JSONObject>() {
@Override
public void onSuccess(JSONObject result) {
WarplyManager.getCampaigns(new WarplyGetCampaignsRequest().setLanguage("en"), new CallbackReceiver<CampaignList>() {
@Override
public void onSuccess(CampaignList result) {
OneTimeWorkRequest mywork = new OneTimeWorkRequest.Builder(EventCampaignService.class).build();
WorkManager.getInstance(Warply.getWarplyContext()).enqueue(mywork);
}
@Override
public void onFailure(int errorCode) {
}
});
}
@Override
public void onFailure(int errorCode) {
WarplyManager.getCampaigns(new WarplyGetCampaignsRequest().setLanguage("en"), new CallbackReceiver<CampaignList>() {
@Override
public void onSuccess(CampaignList result) {
OneTimeWorkRequest mywork = new OneTimeWorkRequest.Builder(EventCampaignService.class).build();
WorkManager.getInstance(Warply.getWarplyContext()).enqueue(mywork);
}
@Override
public void onFailure(int errorCode) {
}
});
}
}, null);
}
}
......