Showing
10 changed files
with
139 additions
and
12 deletions
... | @@ -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-cosbeta38' | 5 | + PUBLISH_VERSION = '4.5.4-cosbeta39' |
6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' |
7 | } | 7 | } |
8 | 8 | ... | ... |
... | @@ -147,6 +147,11 @@ | ... | @@ -147,6 +147,11 @@ |
147 | android:permission="android.permission.BIND_JOB_SERVICE" /> | 147 | android:permission="android.permission.BIND_JOB_SERVICE" /> |
148 | 148 | ||
149 | <service | 149 | <service |
150 | + android:name="ly.warp.sdk.services.EventCampaignService" | ||
151 | + android:exported="false" | ||
152 | + android:permission="android.permission.BIND_JOB_SERVICE" /> | ||
153 | + | ||
154 | + <service | ||
150 | android:name="ly.warp.sdk.services.WarplyBeaconsRangingService" | 155 | android:name="ly.warp.sdk.services.WarplyBeaconsRangingService" |
151 | android:exported="false" /> | 156 | android:exported="false" /> |
152 | 157 | ... | ... |
... | @@ -11,6 +11,8 @@ import android.widget.ProgressBar; | ... | @@ -11,6 +11,8 @@ import android.widget.ProgressBar; |
11 | import android.widget.TextView; | 11 | import android.widget.TextView; |
12 | 12 | ||
13 | import androidx.appcompat.app.AlertDialog; | 13 | import androidx.appcompat.app.AlertDialog; |
14 | +import androidx.work.OneTimeWorkRequest; | ||
15 | +import androidx.work.WorkManager; | ||
14 | 16 | ||
15 | import com.bumptech.glide.Glide; | 17 | import com.bumptech.glide.Glide; |
16 | import com.bumptech.glide.load.engine.DiskCacheStrategy; | 18 | import com.bumptech.glide.load.engine.DiskCacheStrategy; |
... | @@ -18,12 +20,18 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy; | ... | @@ -18,12 +20,18 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy; |
18 | import org.json.JSONObject; | 20 | import org.json.JSONObject; |
19 | 21 | ||
20 | import ly.warp.sdk.R; | 22 | import ly.warp.sdk.R; |
23 | +import ly.warp.sdk.Warply; | ||
21 | import ly.warp.sdk.io.callbacks.CallbackReceiver; | 24 | import ly.warp.sdk.io.callbacks.CallbackReceiver; |
25 | +import ly.warp.sdk.io.models.Campaign; | ||
26 | +import ly.warp.sdk.io.models.CampaignList; | ||
22 | import ly.warp.sdk.io.models.Coupon; | 27 | import ly.warp.sdk.io.models.Coupon; |
23 | import ly.warp.sdk.io.models.CouponList; | 28 | import ly.warp.sdk.io.models.CouponList; |
24 | import ly.warp.sdk.io.models.Couponset; | 29 | import ly.warp.sdk.io.models.Couponset; |
30 | +import ly.warp.sdk.io.request.WarplyGetCampaignsRequest; | ||
25 | import ly.warp.sdk.io.request.WarplyRedeemCouponRequest; | 31 | import ly.warp.sdk.io.request.WarplyRedeemCouponRequest; |
26 | import ly.warp.sdk.io.request.WarplyUserCouponsRequest; | 32 | import ly.warp.sdk.io.request.WarplyUserCouponsRequest; |
33 | +import ly.warp.sdk.services.EventCampaignService; | ||
34 | +import ly.warp.sdk.services.EventService; | ||
27 | import ly.warp.sdk.utils.managers.WarplyManager; | 35 | import ly.warp.sdk.utils.managers.WarplyManager; |
28 | 36 | ||
29 | 37 | ||
... | @@ -45,6 +53,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe | ... | @@ -45,6 +53,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe |
45 | private Coupon mCoupon; | 53 | private Coupon mCoupon; |
46 | private boolean mIsTermsPressed = false; | 54 | private boolean mIsTermsPressed = false; |
47 | private AlertDialog mAlertDialogCouponset; | 55 | private AlertDialog mAlertDialogCouponset; |
56 | + private Campaign mLoyalty; | ||
48 | 57 | ||
49 | // =========================================================== | 58 | // =========================================================== |
50 | // Methods for/from SuperClass/Interfaces | 59 | // Methods for/from SuperClass/Interfaces |
... | @@ -56,6 +65,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe | ... | @@ -56,6 +65,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe |
56 | setContentView(R.layout.activity_couponset_info); | 65 | setContentView(R.layout.activity_couponset_info); |
57 | 66 | ||
58 | mCouponset = (Couponset) getIntent().getSerializableExtra("couponset"); | 67 | mCouponset = (Couponset) getIntent().getSerializableExtra("couponset"); |
68 | + mLoyalty = (Campaign) getIntent().getSerializableExtra("loyalty"); | ||
59 | 69 | ||
60 | mIvBack = findViewById(R.id.iv_couponset_info_back); | 70 | mIvBack = findViewById(R.id.iv_couponset_info_back); |
61 | mTvTerms = findViewById(R.id.tv_terms); | 71 | mTvTerms = findViewById(R.id.tv_terms); |
... | @@ -84,7 +94,9 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe | ... | @@ -84,7 +94,9 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe |
84 | } | 94 | } |
85 | if (view.getId() == R.id.ll_get_gift) { | 95 | if (view.getId() == R.id.ll_get_gift) { |
86 | mPbLoading.setVisibility(View.VISIBLE); | 96 | mPbLoading.setVisibility(View.VISIBLE); |
87 | - WarplyManager.redeemCoupon(new WarplyRedeemCouponRequest().setCouponsetUuid(mCouponset.getUuid()), mRedeemCouponCallback); | 97 | + WarplyManager.redeemCoupon(new WarplyRedeemCouponRequest() |
98 | + .setCouponsetUuid(mCouponset.getUuid()) | ||
99 | + .setCommunicationUuid(mLoyalty.getSessionUUID()), mRedeemCouponCallback); | ||
88 | return; | 100 | return; |
89 | } | 101 | } |
90 | if (view.getId() == R.id.ll_terms_inner) { | 102 | if (view.getId() == R.id.ll_terms_inner) { |
... | @@ -143,6 +155,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe | ... | @@ -143,6 +155,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe |
143 | new Thread(() -> { | 155 | new Thread(() -> { |
144 | if (!Thread.currentThread().isInterrupted()) { | 156 | if (!Thread.currentThread().isInterrupted()) { |
145 | WarplyManager.getUserCouponsWithCouponsets(new WarplyUserCouponsRequest(), mUserCouponsReceiver); | 157 | WarplyManager.getUserCouponsWithCouponsets(new WarplyUserCouponsRequest(), mUserCouponsReceiver); |
158 | + WarplyManager.getCampaigns(new WarplyGetCampaignsRequest().setLanguage("en"), mCampaignsCallback); | ||
146 | } | 159 | } |
147 | }).start(); | 160 | }).start(); |
148 | showDialog(true, 1); | 161 | showDialog(true, 1); |
... | @@ -206,8 +219,22 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe | ... | @@ -206,8 +219,22 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe |
206 | private final CallbackReceiver<CouponList> mUserCouponsReceiver = new CallbackReceiver<CouponList>() { | 219 | private final CallbackReceiver<CouponList> mUserCouponsReceiver = new CallbackReceiver<CouponList>() { |
207 | @Override | 220 | @Override |
208 | public void onSuccess(CouponList result) { | 221 | public void onSuccess(CouponList result) { |
222 | +// Thread.currentThread().interrupt(); | ||
223 | + } | ||
224 | + | ||
225 | + @Override | ||
226 | + public void onFailure(int errorCode) { | ||
209 | Thread.currentThread().interrupt(); | 227 | Thread.currentThread().interrupt(); |
210 | } | 228 | } |
229 | + }; | ||
230 | + | ||
231 | + private CallbackReceiver<CampaignList> mCampaignsCallback = new CallbackReceiver<CampaignList>() { | ||
232 | + @Override | ||
233 | + public void onSuccess(CampaignList result) { | ||
234 | + OneTimeWorkRequest mywork = new OneTimeWorkRequest.Builder(EventCampaignService.class).build(); | ||
235 | + WorkManager.getInstance(CouponsetInfoActivity.this).enqueue(mywork); | ||
236 | +// Thread.currentThread().interrupt(); | ||
237 | + } | ||
211 | 238 | ||
212 | @Override | 239 | @Override |
213 | public void onFailure(int errorCode) { | 240 | public void onFailure(int errorCode) { | ... | ... |
... | @@ -127,7 +127,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene | ... | @@ -127,7 +127,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene |
127 | 127 | ||
128 | @Subscribe() | 128 | @Subscribe() |
129 | public void onMessageEvent(WarplyEventBusManager event) { | 129 | public void onMessageEvent(WarplyEventBusManager event) { |
130 | - if (event.getCcmsAdded() != null) { | 130 | + if (event.getCcmsAdded() != null || event.getCampaignsAdded() != null) { |
131 | filterItems(); | 131 | filterItems(); |
132 | 132 | ||
133 | if (WarplyManagerHelper.getSeasonalList() != null && WarplyManagerHelper.getSeasonalList().size() > 0) { | 133 | if (WarplyManagerHelper.getSeasonalList() != null && WarplyManagerHelper.getSeasonalList().size() > 0) { |
... | @@ -161,6 +161,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene | ... | @@ -161,6 +161,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene |
161 | if (cpns.getUuid().equals(cpnUuid)) { | 161 | if (cpns.getUuid().equals(cpnUuid)) { |
162 | Intent intent = new Intent(GiftsForYouActivity.this, CouponsetInfoActivity.class); | 162 | Intent intent = new Intent(GiftsForYouActivity.this, CouponsetInfoActivity.class); |
163 | intent.putExtra("couponset", (Serializable) cpns); | 163 | intent.putExtra("couponset", (Serializable) cpns); |
164 | + intent.putExtra("loyalty", (Serializable) dataItem.getCampaign()); | ||
164 | startActivity(intent); | 165 | startActivity(intent); |
165 | break; | 166 | break; |
166 | } | 167 | } |
... | @@ -254,6 +255,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene | ... | @@ -254,6 +255,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene |
254 | if (cpns.getUuid().equals(cpnUuid)) { | 255 | if (cpns.getUuid().equals(cpnUuid)) { |
255 | Intent intent = new Intent(GiftsForYouActivity.this, CouponsetInfoActivity.class); | 256 | Intent intent = new Intent(GiftsForYouActivity.this, CouponsetInfoActivity.class); |
256 | intent.putExtra("couponset", (Serializable) cpns); | 257 | intent.putExtra("couponset", (Serializable) cpns); |
258 | + intent.putExtra("loyalty", (Serializable) dataItem.getCampaign()); | ||
257 | startActivity(intent); | 259 | startActivity(intent); |
258 | break; | 260 | break; |
259 | } | 261 | } | ... | ... |
1 | +/* | ||
2 | + * Copyright 2010-2013 Warply Ltd. All rights reserved. | ||
3 | + * | ||
4 | + * Redistribution and use in source and binary forms, without modification, are | ||
5 | + * permitted provided that the following conditions are met: | ||
6 | + * | ||
7 | + * 1. Redistributions of source code must retain the above copyright notice, | ||
8 | + * this list of conditions and the following disclaimer. | ||
9 | + * | ||
10 | + * 2. Redistributions in binary form must reproduce the above copyright notice, | ||
11 | + * this list of conditions and the following disclaimer in the documentation | ||
12 | + * and/or other materials provided with the distribution. | ||
13 | + * | ||
14 | + * THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR | ||
15 | + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
16 | + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO | ||
17 | + * EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
18 | + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
19 | + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, | ||
20 | + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
21 | + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
22 | + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, | ||
23 | + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
24 | + */ | ||
25 | + | ||
26 | +package ly.warp.sdk.io.models; | ||
27 | + | ||
28 | + | ||
29 | +/** | ||
30 | + * Created by Panagiotis Triantafyllou on 21-July-22. | ||
31 | + */ | ||
32 | + | ||
33 | +public class LoyaltyEventModel { | ||
34 | + private boolean success; | ||
35 | + | ||
36 | + public LoyaltyEventModel() { | ||
37 | + this.success = true; | ||
38 | + } | ||
39 | + | ||
40 | + public boolean isSuccess() { | ||
41 | + return success; | ||
42 | + } | ||
43 | + | ||
44 | + public void setSuccess(boolean success) { | ||
45 | + this.success = success; | ||
46 | + } | ||
47 | +} |
... | @@ -25,6 +25,7 @@ public class WarplyRedeemCouponRequest { | ... | @@ -25,6 +25,7 @@ public class WarplyRedeemCouponRequest { |
25 | private final String KEY_ACTION = "action"; | 25 | private final String KEY_ACTION = "action"; |
26 | private final String KEY_ACTION_VALUE = "retrieve_coupon"; | 26 | private final String KEY_ACTION_VALUE = "retrieve_coupon"; |
27 | private final String KEY_COUPONSET = "coupon_set"; | 27 | private final String KEY_COUPONSET = "coupon_set"; |
28 | + private final String KEY_COMMUNICATION_UUID = "communication_uuid"; | ||
28 | 29 | ||
29 | // =========================================================== | 30 | // =========================================================== |
30 | // Fields | 31 | // Fields |
... | @@ -33,6 +34,7 @@ public class WarplyRedeemCouponRequest { | ... | @@ -33,6 +34,7 @@ public class WarplyRedeemCouponRequest { |
33 | private HashMap<String, String> mFilters; | 34 | private HashMap<String, String> mFilters; |
34 | private long mCacheUpdateInterval = 0; | 35 | private long mCacheUpdateInterval = 0; |
35 | private String mCouponsetUuid = ""; | 36 | private String mCouponsetUuid = ""; |
37 | + private String mCommunicationUuid = ""; | ||
36 | 38 | ||
37 | // =========================================================== | 39 | // =========================================================== |
38 | // Constructor | 40 | // Constructor |
... | @@ -83,6 +85,11 @@ public class WarplyRedeemCouponRequest { | ... | @@ -83,6 +85,11 @@ public class WarplyRedeemCouponRequest { |
83 | return this; | 85 | return this; |
84 | } | 86 | } |
85 | 87 | ||
88 | + public WarplyRedeemCouponRequest setCommunicationUuid(String uuid) { | ||
89 | + mCommunicationUuid = uuid; | ||
90 | + return this; | ||
91 | + } | ||
92 | + | ||
86 | /** | 93 | /** |
87 | * Call this to get how often the cached data will be updated. | 94 | * Call this to get how often the cached data will be updated. |
88 | * | 95 | * |
... | @@ -145,6 +152,7 @@ public class WarplyRedeemCouponRequest { | ... | @@ -145,6 +152,7 @@ public class WarplyRedeemCouponRequest { |
145 | try { | 152 | try { |
146 | bodyJsonObject.putOpt(KEY_ACTION, KEY_ACTION_VALUE); | 153 | bodyJsonObject.putOpt(KEY_ACTION, KEY_ACTION_VALUE); |
147 | bodyJsonObject.putOpt(KEY_COUPONSET, mCouponsetUuid); | 154 | bodyJsonObject.putOpt(KEY_COUPONSET, mCouponsetUuid); |
155 | + bodyJsonObject.putOpt(KEY_COMMUNICATION_UUID, mCommunicationUuid); | ||
148 | } catch (JSONException e) { | 156 | } catch (JSONException e) { |
149 | if (WarpConstants.DEBUG) | 157 | if (WarpConstants.DEBUG) |
150 | e.printStackTrace(); | 158 | e.printStackTrace(); | ... | ... |
1 | +package ly.warp.sdk.services; | ||
2 | + | ||
3 | +import android.content.Context; | ||
4 | + | ||
5 | +import androidx.annotation.NonNull; | ||
6 | +import androidx.work.Worker; | ||
7 | +import androidx.work.WorkerParameters; | ||
8 | + | ||
9 | +import org.greenrobot.eventbus.EventBus; | ||
10 | + | ||
11 | +import ly.warp.sdk.io.models.LoyaltyEventModel; | ||
12 | +import ly.warp.sdk.utils.managers.WarplyEventBusManager; | ||
13 | + | ||
14 | +/** | ||
15 | + * Created by Panagiotis Triantafyllou on 21/Ιουλ/2022. | ||
16 | + */ | ||
17 | +public class EventCampaignService extends Worker { | ||
18 | + | ||
19 | + public EventCampaignService(@NonNull Context context, @NonNull WorkerParameters workerParams) { | ||
20 | + super(context, workerParams); | ||
21 | + } | ||
22 | + | ||
23 | + @NonNull | ||
24 | + @Override | ||
25 | + public Result doWork() { | ||
26 | + LoyaltyEventModel campaignsAdded = new LoyaltyEventModel(); | ||
27 | + EventBus.getDefault().post(new WarplyEventBusManager(campaignsAdded)); | ||
28 | + | ||
29 | + return Result.success(); | ||
30 | + } | ||
31 | +} |
... | @@ -34,7 +34,6 @@ import androidx.appcompat.app.AlertDialog; | ... | @@ -34,7 +34,6 @@ import androidx.appcompat.app.AlertDialog; |
34 | import androidx.work.OneTimeWorkRequest; | 34 | import androidx.work.OneTimeWorkRequest; |
35 | import androidx.work.WorkManager; | 35 | import androidx.work.WorkManager; |
36 | 36 | ||
37 | -import org.greenrobot.eventbus.EventBus; | ||
38 | import org.json.JSONObject; | 37 | import org.json.JSONObject; |
39 | 38 | ||
40 | import java.io.Serializable; | 39 | import java.io.Serializable; |
... | @@ -44,8 +43,6 @@ import java.util.HashMap; | ... | @@ -44,8 +43,6 @@ import java.util.HashMap; |
44 | import ly.warp.sdk.R; | 43 | import ly.warp.sdk.R; |
45 | import ly.warp.sdk.Warply; | 44 | import ly.warp.sdk.Warply; |
46 | import ly.warp.sdk.activities.CouponsetInfoActivity; | 45 | import ly.warp.sdk.activities.CouponsetInfoActivity; |
47 | -import ly.warp.sdk.activities.GiftsForYouActivity; | ||
48 | -import ly.warp.sdk.activities.MoreForYouActivity; | ||
49 | import ly.warp.sdk.activities.TelcoActivity; | 46 | import ly.warp.sdk.activities.TelcoActivity; |
50 | import ly.warp.sdk.activities.WarpViewActivity; | 47 | import ly.warp.sdk.activities.WarpViewActivity; |
51 | import ly.warp.sdk.db.WarplyDBHelper; | 48 | import ly.warp.sdk.db.WarplyDBHelper; |
... | @@ -54,7 +51,6 @@ import ly.warp.sdk.io.models.ActiveDFYCouponModel; | ... | @@ -54,7 +51,6 @@ import ly.warp.sdk.io.models.ActiveDFYCouponModel; |
54 | import ly.warp.sdk.io.models.Campaign; | 51 | import ly.warp.sdk.io.models.Campaign; |
55 | import ly.warp.sdk.io.models.CampaignList; | 52 | import ly.warp.sdk.io.models.CampaignList; |
56 | import ly.warp.sdk.io.models.Consumer; | 53 | import ly.warp.sdk.io.models.Consumer; |
57 | -import ly.warp.sdk.io.models.ContexualEventModel; | ||
58 | import ly.warp.sdk.io.models.Coupon; | 54 | import ly.warp.sdk.io.models.Coupon; |
59 | import ly.warp.sdk.io.models.CouponList; | 55 | import ly.warp.sdk.io.models.CouponList; |
60 | import ly.warp.sdk.io.models.Couponset; | 56 | import ly.warp.sdk.io.models.Couponset; |
... | @@ -67,7 +63,6 @@ import ly.warp.sdk.io.request.CosmoteRetrieveSharingRequest; | ... | @@ -67,7 +63,6 @@ import ly.warp.sdk.io.request.CosmoteRetrieveSharingRequest; |
67 | import ly.warp.sdk.io.request.CosmoteSharingRequest; | 63 | import ly.warp.sdk.io.request.CosmoteSharingRequest; |
68 | import ly.warp.sdk.io.request.WarplyIntegrationRequest; | 64 | import ly.warp.sdk.io.request.WarplyIntegrationRequest; |
69 | import ly.warp.sdk.services.EventService; | 65 | import ly.warp.sdk.services.EventService; |
70 | -import ly.warp.sdk.utils.managers.WarplyEventBusManager; | ||
71 | import ly.warp.sdk.utils.managers.WarplyManager; | 66 | import ly.warp.sdk.utils.managers.WarplyManager; |
72 | 67 | ||
73 | /** | 68 | /** |
... | @@ -502,6 +497,7 @@ public class WarplyManagerHelper { | ... | @@ -502,6 +497,7 @@ public class WarplyManagerHelper { |
502 | if (cpns.getUuid().equals(cpnUuid)) { | 497 | if (cpns.getUuid().equals(cpnUuid)) { |
503 | Intent intent = new Intent(context, CouponsetInfoActivity.class); | 498 | Intent intent = new Intent(context, CouponsetInfoActivity.class); |
504 | intent.putExtra("couponset", (Serializable) cpns); | 499 | intent.putExtra("couponset", (Serializable) cpns); |
500 | + intent.putExtra("loyalty", (Serializable) item); | ||
505 | context.startActivity(intent); | 501 | context.startActivity(intent); |
506 | break; | 502 | break; |
507 | } | 503 | } |
... | @@ -557,8 +553,8 @@ public class WarplyManagerHelper { | ... | @@ -557,8 +553,8 @@ public class WarplyManagerHelper { |
557 | * Open Questionnaire | 553 | * Open Questionnaire |
558 | */ | 554 | */ |
559 | public static String openQuestionnaire() { | 555 | public static String openQuestionnaire() { |
560 | - if (mCampaignList != null && mCampaignList.size() > 0) { | 556 | + if (mCampaignListAll != null && mCampaignListAll.size() > 0) { |
561 | - for (Campaign camp : mCampaignList) { | 557 | + for (Campaign camp : mCampaignListAll) { |
562 | if (camp.getOfferCategory().equals("questionnaire")) { | 558 | if (camp.getOfferCategory().equals("questionnaire")) { |
563 | return constructCampaignUrl(camp); | 559 | return constructCampaignUrl(camp); |
564 | } | 560 | } |
... | @@ -572,8 +568,8 @@ public class WarplyManagerHelper { | ... | @@ -572,8 +568,8 @@ public class WarplyManagerHelper { |
572 | * Open Pacing | 568 | * Open Pacing |
573 | */ | 569 | */ |
574 | public static String openPacing() { | 570 | public static String openPacing() { |
575 | - if (mCampaignList != null && mCampaignList.size() > 0) { | 571 | + if (mCampaignListAll != null && mCampaignListAll.size() > 0) { |
576 | - for (Campaign camp : mCampaignList) { | 572 | + for (Campaign camp : mCampaignListAll) { |
577 | if (camp.getOfferCategory().equals("pacing")) { | 573 | if (camp.getOfferCategory().equals("pacing")) { |
578 | String pacingUrl = constructCampaignUrl(camp); | 574 | String pacingUrl = constructCampaignUrl(camp); |
579 | WarpUtils.log("PACING_LOG: " + pacingUrl); | 575 | WarpUtils.log("PACING_LOG: " + pacingUrl); |
... | @@ -598,6 +594,7 @@ public class WarplyManagerHelper { | ... | @@ -598,6 +594,7 @@ public class WarplyManagerHelper { |
598 | if (cpns.getUuid().equals(cpnUuid)) { | 594 | if (cpns.getUuid().equals(cpnUuid)) { |
599 | Intent intent = new Intent(context, CouponsetInfoActivity.class); | 595 | Intent intent = new Intent(context, CouponsetInfoActivity.class); |
600 | intent.putExtra("couponset", (Serializable) cpns); | 596 | intent.putExtra("couponset", (Serializable) cpns); |
597 | + intent.putExtra("loyalty", (Serializable) item); | ||
601 | context.startActivity(intent); | 598 | context.startActivity(intent); |
602 | break; | 599 | break; |
603 | } | 600 | } | ... | ... |
... | @@ -6,6 +6,7 @@ import ly.warp.sdk.io.models.ActiveDFYCouponEventModel; | ... | @@ -6,6 +6,7 @@ import ly.warp.sdk.io.models.ActiveDFYCouponEventModel; |
6 | import ly.warp.sdk.io.models.ContexualEventModel; | 6 | import ly.warp.sdk.io.models.ContexualEventModel; |
7 | import ly.warp.sdk.io.models.CouponEventModel; | 7 | import ly.warp.sdk.io.models.CouponEventModel; |
8 | import ly.warp.sdk.io.models.LoyaltyContextualOfferModel; | 8 | import ly.warp.sdk.io.models.LoyaltyContextualOfferModel; |
9 | +import ly.warp.sdk.io.models.LoyaltyEventModel; | ||
9 | import ly.warp.sdk.io.models.LoyaltyGiftsForYouOfferClickEvent; | 10 | import ly.warp.sdk.io.models.LoyaltyGiftsForYouOfferClickEvent; |
10 | import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel; | 11 | import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel; |
11 | import ly.warp.sdk.io.models.QuestionnaireEventModel; | 12 | import ly.warp.sdk.io.models.QuestionnaireEventModel; |
... | @@ -33,6 +34,7 @@ public class WarplyEventBusManager { | ... | @@ -33,6 +34,7 @@ public class WarplyEventBusManager { |
33 | private CouponEventModel coupon; | 34 | private CouponEventModel coupon; |
34 | private ActiveDFYCouponEventModel activeCoupon; | 35 | private ActiveDFYCouponEventModel activeCoupon; |
35 | private ContexualEventModel ccmsAdded; | 36 | private ContexualEventModel ccmsAdded; |
37 | + private LoyaltyEventModel campaignsAdded; | ||
36 | 38 | ||
37 | public WarplyEventBusManager() { | 39 | public WarplyEventBusManager() { |
38 | 40 | ||
... | @@ -50,6 +52,10 @@ public class WarplyEventBusManager { | ... | @@ -50,6 +52,10 @@ public class WarplyEventBusManager { |
50 | this.ccmsAdded = ccmsAdded; | 52 | this.ccmsAdded = ccmsAdded; |
51 | } | 53 | } |
52 | 54 | ||
55 | + public WarplyEventBusManager(LoyaltyEventModel campaignsAdded) { | ||
56 | + this.campaignsAdded = campaignsAdded; | ||
57 | + } | ||
58 | + | ||
53 | public WarplyEventBusManager(CouponEventModel coupon) { | 59 | public WarplyEventBusManager(CouponEventModel coupon) { |
54 | this.coupon = coupon; | 60 | this.coupon = coupon; |
55 | } | 61 | } |
... | @@ -167,4 +173,8 @@ public class WarplyEventBusManager { | ... | @@ -167,4 +173,8 @@ public class WarplyEventBusManager { |
167 | public ContexualEventModel getCcmsAdded() { | 173 | public ContexualEventModel getCcmsAdded() { |
168 | return ccmsAdded; | 174 | return ccmsAdded; |
169 | } | 175 | } |
176 | + | ||
177 | + public LoyaltyEventModel getCampaignsAdded() { | ||
178 | + return campaignsAdded; | ||
179 | + } | ||
170 | } | 180 | } | ... | ... |
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment