Panagiotis Triantafyllou

vouchers fixes

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<targetSelectedWithDropDown>
<Target>
<type value="QUICK_BOOT_TARGET" />
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="$USER_HOME$/.android/avd/Pixel_6a_API_29.avd" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2023-11-28T10:41:57.588318Z" />
</component>
</project>
\ No newline at end of file
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.5.4r3'
PUBLISH_VERSION = '4.5.5.4r4'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -180,6 +180,38 @@ public class WarplyManagerHelper {
return url;
}
private static String constructCampaignUrl(Campaign item, String dlParam) {
WarplyManager.getSingleCampaign(item.getSessionUUID());
String url = item.getIndexUrl();
// + "?web_id=" + WarpUtils.getWebId(Warply.getWarplyContext())
// + "&app_uuid=" + WarplyProperty.getAppUuid(Warply.getWarplyContext())
// + "&api_key=" + WarpUtils.getApiKey(Warply.getWarplyContext())
// + "&session_uuid=" + item.getSessionUUID()
// + "&access_token=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("access_token")
// + "&refresh_token=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("refresh_token")
// + "&client_id=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_id")
// + "&client_secret=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_secret");
JSONObject params = new JSONObject();
try {
params.putOpt("web_id", WarpUtils.getWebId(Warply.getWarplyContext()));
params.putOpt("app_uuid", WarplyProperty.getAppUuid(Warply.getWarplyContext()));
params.putOpt("api_key", WarpUtils.getApiKey(Warply.getWarplyContext()));
params.putOpt("session_uuid", item.getSessionUUID());
params.putOpt("access_token", WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("access_token"));
params.putOpt("refresh_token", WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("refresh_token"));
params.putOpt("client_id", WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_id"));
params.putOpt("client_secret", WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_secret"));
params.putOpt("dl_param", dlParam);
} catch (JSONException e) {
e.printStackTrace();
}
WarpUtils.setWebviewParams(Warply.getWarplyContext(), params);
return url;
}
public static String constructCampaignUrl(Campaign item, boolean fromWidget) {
item.setNew(false);
String url = item.getIndexUrl();
......@@ -984,6 +1016,25 @@ public class WarplyManagerHelper {
}
/**
* Open DL for SM Deals campaign
*/
public static void handleSMDealsCampaign(Context context, String dlParam) {
if (!noInternetDialog(context, true)) {
noInternetDialog((Activity) context);
return;
}
if (mCampaignListAll != null && mCampaignListAll.size() > 0) {
for (Campaign camp : mCampaignListAll) {
if (camp.getSessionUUID().equals("39e70f0548884020809dda5f78d06c85") || camp.getSessionUUID().equals("8314046c83a44576a03ccc3cd9e825db")) {
context.startActivity(WarpViewActivity.createIntentFromURL(context, WarplyManagerHelper.constructCampaignUrl(camp, dlParam)));
break;
}
}
}
}
/**
* Open Pacing
*/
public static String openPacing() {
......
......@@ -201,7 +201,7 @@
<string name="cos_dlg_negative_button4">Όχι</string>
<string name="cos_dlg_positive_button3">Ναι</string>
<string name="cos_vouchers_title">Υπόλοιπο επιδότησης</string>
<string name="cos_vouchers_info_title">Ενημερώσου για το υπόλοιπο επιδότησης</string>
<string name="cos_vouchers_info_title">Δες το διαθέσιμο υπόλοιπο</string>
<string name="cos_loyalty_history">Ιστορικό</string>
<string name="cos_redeemed_coupons_loyalty_title">Εξαργυρωμένα κουπόνια</string>
<string name="cos_history_info_text">Δες αναλυτικά το συνολικό όφελός σου έως τώρα από κουπόνια</string>
......