Panagiotis Triantafyllou

new additions and minor fixes

...@@ -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"), //6012049321, 6012049322 45 + .setGuid("6012049323"), //6012049321, 6012049322, 6012049323
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-cosbeta37i' 5 + PUBLISH_VERSION = '4.5.4-cosbeta37'
6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk' 6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
7 } 7 }
8 8
......
...@@ -995,7 +995,7 @@ public enum Warply { ...@@ -995,7 +995,7 @@ public enum Warply {
995 try { 995 try {
996 JSONObject extraFields = WarpJSONParser.getJSONFromString(camp.getExtraFields()); 996 JSONObject extraFields = WarpJSONParser.getJSONFromString(camp.getExtraFields());
997 if (extraFields != null) { 997 if (extraFields != null) {
998 - if (extraFields.length() == 0 || !extraFields.has("ccms_offer")) { 998 + if (extraFields.length() == 0 || !(extraFields.has("ccms_offer") || extraFields.has("type"))) {
999 campaignLoyaltyList.add(camp); 999 campaignLoyaltyList.add(camp);
1000 } 1000 }
1001 } 1001 }
......
...@@ -27,8 +27,10 @@ import ly.warp.sdk.io.callbacks.CallbackReceiver; ...@@ -27,8 +27,10 @@ import ly.warp.sdk.io.callbacks.CallbackReceiver;
27 import ly.warp.sdk.io.models.Campaign; 27 import ly.warp.sdk.io.models.Campaign;
28 import ly.warp.sdk.io.models.Consumer; 28 import ly.warp.sdk.io.models.Consumer;
29 import ly.warp.sdk.io.models.LoyaltyContextualOfferModel; 29 import ly.warp.sdk.io.models.LoyaltyContextualOfferModel;
30 +import ly.warp.sdk.io.request.CosmotePostEventRequest;
30 import ly.warp.sdk.io.request.CosmoteSubmitOrderRequest; 31 import ly.warp.sdk.io.request.CosmoteSubmitOrderRequest;
31 import ly.warp.sdk.io.request.WarplyConsumerRequest; 32 import ly.warp.sdk.io.request.WarplyConsumerRequest;
33 +import ly.warp.sdk.utils.WarpUtils;
32 import ly.warp.sdk.utils.managers.WarplyManager; 34 import ly.warp.sdk.utils.managers.WarplyManager;
33 35
34 36
...@@ -247,6 +249,26 @@ public class TelcoActivity extends Activity implements View.OnClickListener { ...@@ -247,6 +249,26 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
247 else 249 else
248 errorActivatingDialog(); 250 errorActivatingDialog();
249 }); 251 });
252 +
253 + if (status == 1) {
254 + new Thread(() -> {
255 + if (!Thread.currentThread().isInterrupted()) {
256 + WarplyManager.postEvent(new CosmotePostEventRequest()
257 + .setCommunicationUuid(mLoyalty.getSessionUUID())
258 + .setUserMsisdn(mSender)
259 + .setOfferAudienceLevel(mCCMS.getOfferAudienceLevel())
260 + .setUACIOfferTrackingCode(mCCMS.getUACIOfferTrackingCode())
261 + .setOfferCode1(mCCMS.getOfferCode1())
262 + .setScore(mCCMS.getScore())
263 + .setZone(mCCMS.getZone())
264 + .setWave(mCCMS.getWave())
265 + .setValidity(mCCMS.getValidity())
266 + .setTreatmentCode(mCCMS.getTreatmentCode()),
267 + mPostCallback);
268 + }
269 + Thread.currentThread().interrupt();
270 + }).start();
271 + }
250 } 272 }
251 273
252 @Override 274 @Override
...@@ -254,4 +276,17 @@ public class TelcoActivity extends Activity implements View.OnClickListener { ...@@ -254,4 +276,17 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
254 runOnUiThread(() -> errorActivatingDialog()); 276 runOnUiThread(() -> errorActivatingDialog());
255 } 277 }
256 }; 278 };
279 +
280 + private CallbackReceiver<JSONObject> mPostCallback = new CallbackReceiver<JSONObject>() {
281 + @Override
282 + public void onSuccess(JSONObject result) {
283 + Thread.currentThread().interrupt();
284 + }
285 +
286 + @Override
287 + public void onFailure(int errorCode) {
288 + WarpUtils.log("POST_EVENT_ERROR " + String.valueOf(errorCode));
289 + Thread.currentThread().interrupt();
290 + }
291 + };
257 } 292 }
......
...@@ -632,7 +632,7 @@ public class WarplyManagerHelper { ...@@ -632,7 +632,7 @@ public class WarplyManagerHelper {
632 try { 632 try {
633 JSONObject extraFields = WarpJSONParser.getJSONFromString(camp.getExtraFields()); 633 JSONObject extraFields = WarpJSONParser.getJSONFromString(camp.getExtraFields());
634 if (extraFields != null) { 634 if (extraFields != null) {
635 - if (extraFields.length() == 0 || !extraFields.has("ccms_offer")) { 635 + if (extraFields.length() == 0 || !(extraFields.has("ccms_offer") || extraFields.has("type"))) {
636 mCampaignList.add(camp); 636 mCampaignList.add(camp);
637 } 637 }
638 } 638 }
......