Panagiotis Triantafyllou

new additions and minor fixes

......@@ -42,7 +42,7 @@ public class SplashActivity extends BaseActivity {
// );
WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest()
.setGuid("6012049321"), //6012049321, 6012049322
.setGuid("6012049323"), //6012049321, 6012049322, 6012049323
mLoginReceiver);
// WarplyManager.verifyTicket(new WarplyVerifyTicketRequest()
......
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4-cosbeta37i'
PUBLISH_VERSION = '4.5.4-cosbeta37'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -995,7 +995,7 @@ public enum Warply {
try {
JSONObject extraFields = WarpJSONParser.getJSONFromString(camp.getExtraFields());
if (extraFields != null) {
if (extraFields.length() == 0 || !extraFields.has("ccms_offer")) {
if (extraFields.length() == 0 || !(extraFields.has("ccms_offer") || extraFields.has("type"))) {
campaignLoyaltyList.add(camp);
}
}
......
......@@ -27,8 +27,10 @@ import ly.warp.sdk.io.callbacks.CallbackReceiver;
import ly.warp.sdk.io.models.Campaign;
import ly.warp.sdk.io.models.Consumer;
import ly.warp.sdk.io.models.LoyaltyContextualOfferModel;
import ly.warp.sdk.io.request.CosmotePostEventRequest;
import ly.warp.sdk.io.request.CosmoteSubmitOrderRequest;
import ly.warp.sdk.io.request.WarplyConsumerRequest;
import ly.warp.sdk.utils.WarpUtils;
import ly.warp.sdk.utils.managers.WarplyManager;
......@@ -247,6 +249,26 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
else
errorActivatingDialog();
});
if (status == 1) {
new Thread(() -> {
if (!Thread.currentThread().isInterrupted()) {
WarplyManager.postEvent(new CosmotePostEventRequest()
.setCommunicationUuid(mLoyalty.getSessionUUID())
.setUserMsisdn(mSender)
.setOfferAudienceLevel(mCCMS.getOfferAudienceLevel())
.setUACIOfferTrackingCode(mCCMS.getUACIOfferTrackingCode())
.setOfferCode1(mCCMS.getOfferCode1())
.setScore(mCCMS.getScore())
.setZone(mCCMS.getZone())
.setWave(mCCMS.getWave())
.setValidity(mCCMS.getValidity())
.setTreatmentCode(mCCMS.getTreatmentCode()),
mPostCallback);
}
Thread.currentThread().interrupt();
}).start();
}
}
@Override
......@@ -254,4 +276,17 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
runOnUiThread(() -> errorActivatingDialog());
}
};
private CallbackReceiver<JSONObject> mPostCallback = new CallbackReceiver<JSONObject>() {
@Override
public void onSuccess(JSONObject result) {
Thread.currentThread().interrupt();
}
@Override
public void onFailure(int errorCode) {
WarpUtils.log("POST_EVENT_ERROR " + String.valueOf(errorCode));
Thread.currentThread().interrupt();
}
};
}
......
......@@ -632,7 +632,7 @@ public class WarplyManagerHelper {
try {
JSONObject extraFields = WarpJSONParser.getJSONFromString(camp.getExtraFields());
if (extraFields != null) {
if (extraFields.length() == 0 || !extraFields.has("ccms_offer")) {
if (extraFields.length() == 0 || !(extraFields.has("ccms_offer") || extraFields.has("type"))) {
mCampaignList.add(camp);
}
}
......