Panagiotis Triantafyllou

minor fixes, added trackers

Showing 24 changed files with 133 additions and 13 deletions
......@@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity {
public void onWarplyReady() {
if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) {
WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest()
.setGuid("7000000831"), //6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons
.setGuid("6006552990"), //6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990
mLoginReceiver);
} else {
startNextActivity();
......
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4-cosbeta81'
PUBLISH_VERSION = '4.5.4-cosbeta85'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -165,11 +165,11 @@
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE" />
<!-- android:stopWithTask="false"-->
<!-- android:process=":warplyHealthService"-->
<service
android:name="ly.warp.sdk.services.WarplyHealthService"
android:exported="false"
android:stopWithTask="false"
android:process=":warplyHealthService"
android:permission="android.permission.BIND_JOB_SERVICE" />
<service
......
......@@ -22,6 +22,7 @@ import io.github.inflationx.viewpump.ViewPumpContextWrapper;
import ly.warp.sdk.R;
import ly.warp.sdk.io.models.Coupon;
import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
import ly.warp.sdk.views.adapters.ActiveCouponAdapter;
......@@ -83,6 +84,7 @@ public class ActiveCouponsActivity extends Activity implements View.OnClickListe
mRecyclerCoupons.setAdapter(mAdapterCoupons);
mAdapterCoupons.getPositionClicks()
.doOnNext(coupon -> {
WarplyAnalyticsManager.logTrackersEvent("click", ("Coupon").concat(":").concat(coupon.getName()));
Intent intent = new Intent(ActiveCouponsActivity.this, CouponInfoActivity.class);
intent.putExtra("coupon", (Serializable) coupon);
startActivity(intent);
......@@ -100,6 +102,7 @@ public class ActiveCouponsActivity extends Activity implements View.OnClickListe
@Override
public void onResume() {
super.onResume();
WarplyAnalyticsManager.logTrackersEvent("screen", "ActiveCouponsScreen");
}
@Override
......
......@@ -19,6 +19,7 @@ import ly.warp.sdk.io.models.Coupon;
import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.io.models.MergedActiveGifts;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
import ly.warp.sdk.views.adapters.MergedActiveGiftsAdapter;
......@@ -60,6 +61,7 @@ public class ActiveGiftsActivity extends Activity implements View.OnClickListene
@Override
public void onResume() {
super.onResume();
WarplyAnalyticsManager.logTrackersEvent("screen", "ActiveGiftsScreen");
}
@Override
......
......@@ -30,6 +30,7 @@ import ly.warp.sdk.io.models.LoyaltyContextualOfferModel;
import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel;
import ly.warp.sdk.io.request.CosmoteSubmitOrderRequest;
import ly.warp.sdk.io.request.WarplyConsumerRequest;
import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
import ly.warp.sdk.utils.managers.WarplyEventBusManager;
import ly.warp.sdk.utils.managers.WarplyManager;
......@@ -77,6 +78,7 @@ public class ContextualActivity extends Activity implements View.OnClickListener
@Override
public void onResume() {
super.onResume();
WarplyAnalyticsManager.logTrackersEvent("screen", "ContextualScreen");
// new Thread(() -> {
// if (!Thread.currentThread().isInterrupted()) {
......@@ -185,6 +187,10 @@ public class ContextualActivity extends Activity implements View.OnClickListener
}
private void activateGift() {
WarplyAnalyticsManager.logTrackersEvent("click", ("ActivateContextual")
.concat(":")
.concat(mCCMS.getSessionId()));
new Thread(() -> {
if (!Thread.currentThread().isInterrupted()) {
WarplyManager.submitOrder(new CosmoteSubmitOrderRequest()
......
......@@ -35,6 +35,7 @@ import ly.warp.sdk.io.models.Coupon;
import ly.warp.sdk.io.models.Couponset;
import ly.warp.sdk.services.EventCouponsService;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
public class CouponInfoActivity extends Activity implements View.OnClickListener {
......@@ -89,6 +90,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
@Override
public void onResume() {
super.onResume();
WarplyAnalyticsManager.logTrackersEvent("screen", "CouponScreen");
}
@Override
......@@ -109,6 +111,10 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
return;
}
if (view.getId() == R.id.ll_gift_it) {
WarplyAnalyticsManager.logTrackersEvent("click", ("ShareCoupon")
.concat(":")
.concat(mCoupon.getName()));
Intent intent = new Intent(CouponInfoActivity.this, CouponShareActivity.class);
intent.putExtra("coupon", (Serializable) mCoupon);
intent.putExtra("isFromWallet", mIsFromWallet);
......@@ -119,6 +125,8 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
return;
}
if (view.getId() == R.id.ll_shops) {
WarplyAnalyticsManager.logTrackersEvent("click", "SeeShops");
Intent intent = new Intent(CouponInfoActivity.this, ShopsActivity.class);
intent.putExtra("couponset", (Serializable) mCouponset);
startActivity(intent);
......
......@@ -38,6 +38,7 @@ import ly.warp.sdk.io.models.WarplyCouponsChangedEventModel;
import ly.warp.sdk.io.request.CosmoteCouponSharingRequest;
import ly.warp.sdk.io.request.WarplyConsumerRequest;
import ly.warp.sdk.io.request.WarplyUserCouponsRequest;
import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
import ly.warp.sdk.utils.managers.WarplyEventBusManager;
import ly.warp.sdk.utils.managers.WarplyManager;
......@@ -92,6 +93,7 @@ public class CouponShareActivity extends Activity implements View.OnClickListene
@Override
public void onResume() {
super.onResume();
WarplyAnalyticsManager.logTrackersEvent("screen", "CouponShareScreen");
new Thread(() -> {
if (!Thread.currentThread().isInterrupted()) {
......@@ -278,6 +280,10 @@ public class CouponShareActivity extends Activity implements View.OnClickListene
.setTitle(R.string.cos_dlg_positive_coupon_title)
.setMessage(R.string.cos_dlg_positive_coupon_subtitle)
.setPositiveButton(R.string.cos_dlg_negative_button3, (dialogPositive, whichPositive) -> {
WarplyAnalyticsManager.logTrackersEvent("click", ("ShareCoupon")
.concat(":")
.concat(mCoupon.getName()));
new Thread(() -> {
if (!Thread.currentThread().isInterrupted()) {
WarplyManager.cosmoteCouponSharing(new CosmoteCouponSharingRequest()
......
......@@ -40,6 +40,7 @@ import ly.warp.sdk.io.request.WarplyUserCouponsRequest;
import ly.warp.sdk.services.EventCampaignService;
import ly.warp.sdk.utils.WarpUtils;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
import ly.warp.sdk.utils.managers.WarplyEventBusManager;
import ly.warp.sdk.utils.managers.WarplyManager;
......@@ -96,6 +97,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
@Override
public void onResume() {
super.onResume();
WarplyAnalyticsManager.logTrackersEvent("screen", "CouponsetScreen");
}
@Override
......@@ -106,6 +108,9 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
}
if (view.getId() == R.id.ll_get_gift) {
mPbLoading.setVisibility(View.VISIBLE);
WarplyAnalyticsManager.logTrackersEvent("click", ("RetrieveCoupon")
.concat(":")
.concat(mCouponset.getUuid()));
if (mCcms == null) {
WarplyManager.redeemCoupon(new WarplyRedeemCouponRequest()
.setCouponsetUuid(mCouponset.getUuid())
......
......@@ -42,6 +42,7 @@ import ly.warp.sdk.services.EventCampaignService;
import ly.warp.sdk.utils.WarpJSONParser;
import ly.warp.sdk.utils.WarpUtils;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
import ly.warp.sdk.utils.managers.WarplyEventBusManager;
import ly.warp.sdk.utils.managers.WarplyManager;
import ly.warp.sdk.views.adapters.MergedGiftsAdapter;
......@@ -118,6 +119,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
@Override
public void onResume() {
super.onResume();
WarplyAnalyticsManager.logTrackersEvent("screen", "GiftsForYouScreen");
mTimer = 0;
mSecondsHandler.post(new Runnable() {
@Override
......@@ -262,6 +264,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
analyticsEvent.setParameter("type", "coupon");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
WarplyAnalyticsManager.logTrackersEvent("click", ("Loyalty").concat(":").concat(dataItem.getCampaign().getSessionUUID()));
WarplyManager.getSingleCampaign(dataItem.getCampaign().getSessionUUID());
Intent intent = new Intent(GiftsForYouActivity.this, CouponsetInfoActivity.class);
intent.putExtra("couponset", (Serializable) cpns);
......@@ -272,6 +275,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
}
}
} else {
WarplyAnalyticsManager.logTrackersEvent("click", ("Loyalty").concat(":").concat(dataItem.getCampaign().getSessionUUID()));
startActivityForResult(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(dataItem.getCampaign())), 1004);
}
}
......@@ -296,6 +300,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
analyticsEvent.setParameter("type", "coupon");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
WarplyAnalyticsManager.logTrackersEvent("click", ("Loyalty").concat(":").concat(dataItem.getCampaign().getSessionUUID()));
WarplyManager.getSingleCampaign(dataItem.getCampaign().getSessionUUID());
Intent intent = new Intent(GiftsForYouActivity.this, CouponsetInfoActivity.class);
intent.putExtra("couponset", (Serializable) cpns);
......@@ -305,6 +310,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
}
}
} else {
WarplyAnalyticsManager.logTrackersEvent("click", ("Loyalty").concat(":").concat(dataItem.getCampaign().getSessionUUID()));
startActivityForResult(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(dataItem.getCampaign())), 1004);
}
}
......@@ -327,6 +333,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
analyticsEvent.setParameter("type", "gift");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
WarplyAnalyticsManager.logTrackersEvent("click", ("Telco").concat(":").concat(ccms.getSessionId()));
WarplyManager.getSingleCampaign(dataItem.getCampaign().getSessionUUID());
Intent intent = new Intent(GiftsForYouActivity.this, TelcoActivity.class);
intent.putExtra("ccms", ccms);
......@@ -340,15 +347,18 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
if (extraFields.has("ccms_offer") && extraFields.optString("ccms_offer").equals("true")) {
for (LoyaltyContextualOfferModel ccms : WarplyManagerHelper.getCCMSLoyaltyCampaigns()) {
if (ccms.getLoyaltyCampaignId().equals(dataItem.getCampaign().getSessionUUID())) {
WarplyAnalyticsManager.logTrackersEvent("click", ("Contextual").concat(":").concat(ccms.getSessionId()));
startActivityForResult(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCcmsUrl(dataItem.getCampaign(), ccms)), 1004);
break;
}
}
} else {
WarplyAnalyticsManager.logTrackersEvent("click", ("Loyalty").concat(":").concat(dataItem.getCampaign().getSessionUUID()));
startActivityForResult(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(dataItem.getCampaign())), 1004);
}
}
} catch (Exception exception) {
WarplyAnalyticsManager.logTrackersEvent("click", ("Loyalty").concat(":").concat(dataItem.getCampaign().getSessionUUID()));
startActivityForResult(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(dataItem.getCampaign())), 1004);
}
} else if (dataItem.getDataType() == 2) {
......@@ -371,6 +381,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
analyticsEvent.setParameter("type", "gift");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
WarplyAnalyticsManager.logTrackersEvent("click", ("Contextual").concat(":").concat(dataItem.getCCMS().getSessionId()));
Intent intent = new Intent(GiftsForYouActivity.this, ContextualActivity.class);
intent.putExtra("ccms", dataItem.getCCMS());
startActivity(intent);
......
......@@ -35,6 +35,7 @@ import ly.warp.sdk.io.models.SharingList;
import ly.warp.sdk.io.request.WarplySharingHistoryRequest;
import ly.warp.sdk.utils.WarpUtils;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
import ly.warp.sdk.utils.managers.WarplyEventBusManager;
import ly.warp.sdk.utils.managers.WarplyManager;
import ly.warp.sdk.views.adapters.ExpiredCouponAdapter;
......@@ -91,6 +92,7 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis
@Override
public void onResume() {
super.onResume();
WarplyAnalyticsManager.logTrackersEvent("screen", "LoyaltyHistoryScreen");
mTimer = 0;
mSecondsHandler.post(new Runnable() {
@Override
......@@ -137,6 +139,10 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis
return;
}
if (view.getId() == R.id.ll_tab_expired) {
WarplyAnalyticsManager.logTrackersEvent("click", ("LoyaltyHistoryScreen")
.concat(":")
.concat("TabExpired"));
mLlExpiredTab.setBackgroundResource(R.drawable.bottom_border_gradient2);
TextView expiredTab = findViewById(R.id.tv_expired_tab);
expiredTab.setTextColor(ContextCompat.getColor(this, R.color.cos_cyan4));
......@@ -160,6 +166,10 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis
return;
}
if (view.getId() == R.id.ll_tab_shared) {
WarplyAnalyticsManager.logTrackersEvent("click", ("LoyaltyHistoryScreen")
.concat(":")
.concat("TabShared"));
mLlSharedTab.setBackgroundResource(R.drawable.bottom_border_gradient2);
TextView sharedTab = findViewById(R.id.tv_shared_tab);
sharedTab.setTextColor(ContextCompat.getColor(this, R.color.cos_cyan4));
......
......@@ -49,6 +49,7 @@ import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel;
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.WarplyAnalyticsManager;
import ly.warp.sdk.utils.managers.WarplyEventBusManager;
import ly.warp.sdk.views.adapters.ActiveCouponAdapter;
......@@ -194,6 +195,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
@Override
public void onResume() {
super.onResume();
WarplyAnalyticsManager.logTrackersEvent("screen", "LoyaltyWalletScreen");
mTimer = 0;
mSecondsHandler.post(new Runnable() {
@Override
......@@ -225,10 +227,18 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
return;
}
if (view.getId() == R.id.ll_user_questionnaire || view.getId() == R.id.ll_user_badge) {
WarplyAnalyticsManager.logTrackersEvent("click", ("LoyaltyWalletScreen")
.concat(":")
.concat("Questionnaire"));
startActivityForResult(WarpViewActivity.createIntentFromURL(LoyaltyWallet.this, WarplyManagerHelper.openQuestionnaire()), 1000);
return;
}
if (view.getId() == R.id.cl_deals_cos) {
WarplyAnalyticsManager.logTrackersEvent("click", ("LoyaltyWalletScreen")
.concat(":")
.concat("DealsBanner"));
WarpUtils.log("DFY coupon banner pressed!");
WarplyDealsAnalysisEventModel warplyDealsAnalysisEventModel = new WarplyDealsAnalysisEventModel();
warplyDealsAnalysisEventModel.setPressed(true);
......@@ -241,6 +251,10 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
return;
}
if (view.getId() == R.id.cl_deals_win) {
WarplyAnalyticsManager.logTrackersEvent("click", ("LoyaltyWalletScreen")
.concat(":")
.concat("LoyaltyBanner"));
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("did_tap_gifts_for_you_badge");
analyticsEvent.setParameter("screen", "Loyalty Wallet");
......@@ -251,6 +265,10 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
return;
}
if (view.getId() == R.id.cl_mygifts) {
WarplyAnalyticsManager.logTrackersEvent("click", ("LoyaltyWalletScreen")
.concat(":")
.concat("ActiveDealsBanner"));
ActiveDFYCouponEventModel activeCouponEventModel = new ActiveDFYCouponEventModel();
activeCouponEventModel.setPressed(true);
EventBus.getDefault().post(new WarplyEventBusManager(activeCouponEventModel));
......@@ -316,6 +334,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
mRecyclerCoupons.setAdapter(mAdapterCoupons);
mAdapterCoupons.getPositionClicks()
.doOnNext(coupon -> {
WarplyAnalyticsManager.logTrackersEvent("click", ("Coupon").concat(":").concat(coupon.getName()));
Intent intent = new Intent(LoyaltyWallet.this, CouponInfoActivity.class);
intent.putExtra("coupon", (Serializable) coupon);
intent.putExtra("isFromWallet", true);
......@@ -369,6 +388,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
mRecyclerCoupons.setAdapter(mAdapterCoupons);
mAdapterCoupons.getPositionClicks()
.doOnNext(coupon -> {
WarplyAnalyticsManager.logTrackersEvent("click", ("Coupon").concat(":").concat(coupon.getName()));
Intent intent = new Intent(LoyaltyWallet.this, CouponInfoActivity.class);
intent.putExtra("coupon", (Serializable) coupon);
intent.putExtra("isFromWallet", true);
......
......@@ -38,6 +38,7 @@ import ly.warp.sdk.services.EventCampaignService;
import ly.warp.sdk.utils.WarpJSONParser;
import ly.warp.sdk.utils.WarpUtils;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
import ly.warp.sdk.utils.managers.WarplyEventBusManager;
import ly.warp.sdk.utils.managers.WarplyManager;
import ly.warp.sdk.views.adapters.MergedMoreAdapter;
......@@ -142,6 +143,7 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener
@Override
public void onResume() {
super.onResume();
WarplyAnalyticsManager.logTrackersEvent("screen", "MoreForYouScreen");
mTimer = 0;
mSecondsHandler.post(new Runnable() {
@Override
......@@ -430,6 +432,8 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener
if (extraFields.has("type") && extraFields.optString("type").equals("telco")) {
for (LoyaltyContextualOfferModel ccms : WarplyManagerHelper.getCCMSLoyaltyCampaigns()) {
if (ccms.getLoyaltyCampaignId().equals(moreItem.getSessionUUID())) {
WarplyAnalyticsManager.logTrackersEvent("click", ("Telco").concat(":").concat(ccms.getSessionId()));
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("loyalty_sdk_offer_selected");
analyticsEvent.setParameter("name", ccms.getTitle());
......@@ -450,15 +454,18 @@ 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());
WarplyAnalyticsManager.logTrackersEvent("click", ("Contextual").concat(":").concat(ccms.getSessionId()));
startActivityForResult(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCcmsUrl(moreItem, ccms)), 1003);
break;
}
}
} else {
WarplyAnalyticsManager.logTrackersEvent("click", ("Loyalty").concat(":").concat(moreItem.getSessionUUID()));
startActivityForResult(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(moreItem)), 1003);
}
}
} catch (Exception exception) {
WarplyAnalyticsManager.logTrackersEvent("click", ("Loyalty").concat(":").concat(moreItem.getSessionUUID()));
startActivityForResult(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(moreItem)), 1003);
}
}
......@@ -470,6 +477,7 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener
analyticsEvent.setParameter("type", "gift");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
WarplyAnalyticsManager.logTrackersEvent("click", ("Contextual").concat(":").concat(ccmsItem.getSessionId()));
Intent intent = new Intent(MoreForYouActivity.this, ContextualActivity.class);
intent.putExtra("ccms", ccmsItem);
startActivity(intent);
......
......@@ -44,6 +44,7 @@ import ly.warp.sdk.io.models.Merchant;
import ly.warp.sdk.io.models.MerchantList;
import ly.warp.sdk.io.request.WarplyMerchantsRequest;
import ly.warp.sdk.utils.constants.WarpConstants;
import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
import ly.warp.sdk.utils.managers.WarplyManager;
......@@ -88,6 +89,7 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
@Override
public void onResume() {
super.onResume();
WarplyAnalyticsManager.logTrackersEvent("screen", "ShopsScreen");
}
@Override
......@@ -197,6 +199,7 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
public boolean onMarkerClick(@NonNull Marker marker) {
for (Merchant merch : mMerchantList) {
if (merch.getUuid().equals(marker.getSnippet())) {
WarplyAnalyticsManager.logTrackersEvent("click", ("ShopsScreenMarker").concat(":").concat(marker.getSnippet()));
final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this);
bottomSheetDialog.setContentView(R.layout.dl_map_pin);
......
......@@ -33,6 +33,7 @@ import ly.warp.sdk.io.models.LoyaltyContextualOfferModel;
import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel;
import ly.warp.sdk.io.request.CosmoteSubmitOrderRequest;
import ly.warp.sdk.io.request.WarplyConsumerRequest;
import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
import ly.warp.sdk.utils.managers.WarplyEventBusManager;
import ly.warp.sdk.utils.managers.WarplyManager;
......@@ -90,6 +91,7 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
@Override
public void onResume() {
super.onResume();
WarplyAnalyticsManager.logTrackersEvent("screen", "TelcoScreen");
// new Thread(() -> {
// if (!Thread.currentThread().isInterrupted()) {
......@@ -222,6 +224,7 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
}
private void activateGift() {
WarplyAnalyticsManager.logTrackersEvent("click", ("ActivateTelco").concat(":").concat(mCCMS.getSessionId()));
new Thread(() -> {
if (!Thread.currentThread().isInterrupted()) {
WarplyManager.submitOrder(new CosmoteSubmitOrderRequest()
......
......@@ -149,6 +149,11 @@ public class VolleyTransformer implements Listener<JSONObject>, ErrorListener {
if (response.has("result")) {
JSONObject obj = response.optJSONObject("result");
if (obj != null) {
if ((response.has("status") && response.optInt("status") == 7) && (obj.has("status") && obj.optString("status").equals("rejected"))) {
mListener.onSuccess(response);
return;
}
if (obj.has("status") && obj.optString("status").equals("accepted")) {
mListener.onSuccess(response);
return;
......
......@@ -152,8 +152,10 @@ public class HttpClientStack implements HttpStack {
headers.add(new BasicHeader(WarpConstants.HEADER_AUTHORIZATION,
"Bearer " + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("access_token")));
} else if (request.getTag() != null && request.getTag().equals("cosuser")) {
// prod MVBQNFhCQzhFYTJBaUdCNkJWZGFGUERlTTNLQ3kzMjU6YzViMzAyZDY5N2FiNGY3NzhiNThhMTg0YzBkZWRmNGU=
// dev MWlTM0EyNjcxT2Q0a1B5QkIydEs1ZU5uRENhR0NWQjQ6MjI4MjA4ZTliMTQzNGQ2MmIxNGI3ZDAzYjM2ZjUwMzg=
headers.add(new BasicHeader(WarpConstants.HEADER_AUTHORIZATION,
"Basic MWlTM0EyNjcxT2Q0a1B5QkIydEs1ZU5uRENhR0NWQjQ6MjI4MjA4ZTliMTQzNGQ2MmIxNGI3ZDAzYjM2ZjUwMzg="));
"Basic MVBQNFhCQzhFYTJBaUdCNkJWZGFGUERlTTNLQ3kzMjU6YzViMzAyZDY5N2FiNGY3NzhiNThhMTg0YzBkZWRmNGU="));
}
httpPost.setHeaders(headers.toArray(new Header[headers.size()]));
byte[] body = request.getBody();
......
......@@ -101,8 +101,10 @@ public class HurlStack implements HttpStack {
map.put(WarpConstants.HEADER_AUTHORIZATION,
"Bearer " + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("access_token"));
} else if (request.getTag() != null && request.getTag().equals("cosuser")) {
// prod MVBQNFhCQzhFYTJBaUdCNkJWZGFGUERlTTNLQ3kzMjU6YzViMzAyZDY5N2FiNGY3NzhiNThhMTg0YzBkZWRmNGU=
// dev MWlTM0EyNjcxT2Q0a1B5QkIydEs1ZU5uRENhR0NWQjQ6MjI4MjA4ZTliMTQzNGQ2MmIxNGI3ZDAzYjM2ZjUwMzg=
map.put(WarpConstants.HEADER_AUTHORIZATION,
"Basic MWlTM0EyNjcxT2Q0a1B5QkIydEs1ZU5uRENhR0NWQjQ6MjI4MjA4ZTliMTQzNGQ2MmIxNGI3ZDAzYjM2ZjUwMzg=");
"Basic MVBQNFhCQzhFYTJBaUdCNkJWZGFGUERlTTNLQ3kzMjU6YzViMzAyZDY5N2FiNGY3NzhiNThhMTg0YzBkZWRmNGU=");
}
if (mUrlRewriter != null) {
String rewritten = mUrlRewriter.rewriteUrl(url);
......
......@@ -106,9 +106,9 @@ public class WarplyHealthService extends Service implements SensorEventListener
// b.setContentText(getString(R.string.cos_steps_for_good_notification_subtitle));
b.setStyle(new NotificationCompat.BigTextStyle().bigText(getString(R.string.cos_steps_for_good_notification_subtitle)));
b.setContentIntent(pbIntent);
b.setAutoCancel(false);
b.setAutoCancel(true);
b.setOngoing(true);
b.setCategory(Notification.CATEGORY_SERVICE);
// b.setCategory(Notification.CATEGORY_SERVICE);
b.setSmallIcon(R.drawable.ic_launcher);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && notificationManager != null) {
NotificationChannel notificationChannel = new NotificationChannel(STEPS_CHANNEL_ID, "steps_notification_channel", NotificationManager.IMPORTANCE_DEFAULT);
......
......@@ -145,6 +145,8 @@ public class WarpUtils {
+ "user_non_telco";
private static final String PREFERENCES_STEPS_METERS_COUNTER = PREFERENCES_PREFIX
+ "steps_meters_counter";
private static final String PREFERENCES_TRACKERS_ENABLED = PREFERENCES_PREFIX
+ "trackers_enabled";
private static SharedPreferences _prefs;
......@@ -644,6 +646,17 @@ public class WarpUtils {
return Double.longBitsToDouble(prefs.getLong(PREFERENCES_STEPS_METERS_COUNTER, 0));
}
public static void setTrackersEnabled(Context context, boolean isEnabled) {
SharedPreferences.Editor editor = getPreferences(context).edit();
editor.putBoolean(PREFERENCES_TRACKERS_ENABLED, isEnabled);
editor.apply();
}
public static boolean getTrackersEnabled(Context context) {
SharedPreferences prefs = getPreferences(context);
return prefs.getBoolean(PREFERENCES_TRACKERS_ENABLED, false);
}
public static JSONObject getDeviceInfoObject(Context context) {
SharedPreferences prefs = getPreferences(context);
try {
......
......@@ -84,6 +84,7 @@ import ly.warp.sdk.io.request.WarplyUserCouponsRequest;
import ly.warp.sdk.services.EventService;
import ly.warp.sdk.services.FCMBaseMessagingService;
import ly.warp.sdk.services.WarplyHealthService;
import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
import ly.warp.sdk.utils.managers.WarplyEventBusManager;
import ly.warp.sdk.utils.managers.WarplyManager;
......@@ -653,6 +654,7 @@ public class WarplyManagerHelper {
analyticsEvent.setParameter("type", "gift");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
WarplyAnalyticsManager.logTrackersEvent("click", ("Contextual").concat(":").concat(item.getSessionId()));
Intent intent = new Intent(context, ContextualActivity.class);
intent.putExtra("ccms", item);
context.startActivity(intent);
......@@ -744,7 +746,7 @@ public class WarplyManagerHelper {
}
WarpUtils.setWebviewParams(Warply.getWarplyContext(), params);
WarplyAnalyticsManager.logTrackersEvent("click", ("Contextual").concat(":").concat(item.getSessionId()));
context.startActivity(WarpViewActivity.createIntentFromURL(context, url));
break;
}
......@@ -756,6 +758,7 @@ public class WarplyManagerHelper {
analyticsEvent.setParameter("type", "gift");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
WarplyAnalyticsManager.logTrackersEvent("click", ("Telco").concat(":").concat(item.getSessionId()));
WarplyManager.getSingleCampaign(camp.getSessionUUID());
Intent intent = new Intent(context, TelcoActivity.class);
intent.putExtra("ccms", item);
......@@ -799,6 +802,7 @@ public class WarplyManagerHelper {
analyticsEvent.setParameter("type", "coupon");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
WarplyAnalyticsManager.logTrackersEvent("click", ("Loyalty").concat(":").concat(item.getSessionUUID()));
WarplyManager.getSingleCampaign(item.getSessionUUID());
Intent intent = new Intent(context, CouponsetInfoActivity.class);
intent.putExtra("couponset", (Serializable) cpns);
......@@ -809,6 +813,7 @@ public class WarplyManagerHelper {
}
}
} else {
WarplyAnalyticsManager.logTrackersEvent("click", ("Loyalty").concat(":").concat(item.getSessionUUID()));
context.startActivity(WarpViewActivity.createIntentFromURL(context, WarplyManagerHelper.constructCampaignUrl(item)));
}
}
......@@ -833,6 +838,7 @@ public class WarplyManagerHelper {
analyticsEvent.setParameter("type", "coupon");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
WarplyAnalyticsManager.logTrackersEvent("click", ("Loyalty").concat(":").concat(item.getSessionUUID()));
WarplyManager.getSingleCampaign(item.getSessionUUID());
Intent intent = new Intent(context, CouponsetInfoActivity.class);
intent.putExtra("couponset", (Serializable) cpns);
......@@ -842,6 +848,7 @@ public class WarplyManagerHelper {
}
}
} else {
WarplyAnalyticsManager.logTrackersEvent("click", ("Loyalty").concat(":").concat(item.getSessionUUID()));
context.startActivity(WarpViewActivity.createIntentFromURL(context, WarplyManagerHelper.constructCampaignUrl(item)));
}
}
......@@ -852,6 +859,7 @@ public class WarplyManagerHelper {
return;
}
WarplyAnalyticsManager.logTrackersEvent("click", ("Loyalty").concat(":").concat(item.getSessionUUID()));
context.startActivity(WarpViewActivity.createIntentFromURL(context, WarplyManagerHelper.constructCampaignUrl(item)));
}
}
......@@ -985,7 +993,7 @@ public class WarplyManagerHelper {
}
public static void setTrackersEnabled(boolean isEnabled) {
// WarpUtils.setTrackersEnabled();
WarpUtils.setTrackersEnabled(Warply.getWarplyContext(), isEnabled);
// JSONObject obj = new JSONObject();
// try {
......
......@@ -57,6 +57,11 @@ public class WarplyAnalyticsManager {
sendEvent(eventPage, eventId, metadata, false);
}
public static void logTrackersEvent(String eventType, String eventName) {
if (WarpUtils.getTrackersEnabled(Warply.getWarplyContext()))
sendEvent(null, eventType.concat(":").concat(eventName), null, false);
}
/**
* Log screen events so after we can check if there are in app campaigns to show
* (per screen or all screens). After we send the event with priority we make
......
......@@ -2124,7 +2124,7 @@ public class WarplyManager {
@Override
public void onSuccess(JSONObject result) {
int status = result.optInt("status", 2);
if (status == 1 || status == 4 || status == 5)
if (status == 1 || status == 4 || status == 5 || status == 7)
receiver.onSuccess(result);
else
receiver.onFailure(status);
......
......@@ -117,7 +117,7 @@
<string name="cos_shared_gifts_tab">Μοιρασμένα δώρα</string>
<string name="cos_shared_coupon_receiver">Εκπτωτικό κουπόνι προς</string>
<string name="cos_shared_coupon_sender">Έκπτωτικό κουπόνι από</string>
<string name="cos_steps_for_good_notification_title">Steps for Good</string>
<string name="cos_steps_for_good_notification_title">Steps For Good</string>
<string name="cos_empty_wallet">Δεν έχεις κάποιον ενεργό κωδικό ή κουπόνι! Μπες τώρα στην ενότητα COSMOTE For You και βρες αποκλειστικές προσφορές!</string>
<string name="cos_wallet_text1">Μέχρι τώρα έχεις κερδίσει&#160;</string>
<string name="cos_wallet_text2">&#160;με το DEALS for YOU!</string>
......@@ -138,7 +138,7 @@
<string name="cos_dlg_pacing_goal">Πέτυχες το στόχο του μήνα! Διάλεξε το δώρο που επιθυμείς να ενεργοποιήσεις!</string>
<string name="cos_mfy_other">ΆΛΛΕΣ</string>
<string name="cos_coupon_share_telco">Επιλογή σύνδεσης</string>
<string name="cos_steps_for_good_notification_subtitle">Περπάτησε κάθε μέρα περισσότερο για να ολοκληρώσεις το στόχο του μήνα και να ξεκλειδώσεις μοναδικές προσφορές!</string>
<string name="cos_steps_for_good_notification_subtitle">Η υπηρεσία είναι ενεργή για την καταχώρηση των βημάτων σας.</string>
<string name="cos_comma">,</string>
<string name="cos_dlg_non_telco_title">Αδυναμία ενεργοποίησης</string>
<string name="cos_share_no_assets">Για την αποστολή του δώρου σου χρειάζεται να έχεις κινητό COSMOTE.</string>
......