Panagiotis Triantafyllou

changes for cosmote pass fixes

......@@ -102,7 +102,7 @@ public class MarketPassActivity extends Activity implements View.OnClickListener
}
WarplyAnalyticsManager.logTrackersEvent(this, "click", "MarketPassInfoScreen");
startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.getMarketPassMapUrl(MarketPassActivity.this)));
startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.openSupermarketCampaign(MarketPassActivity.this)));
}
}
if (view.getId() == R.id.iv_coupons_info) {
......
......@@ -137,46 +137,26 @@ public class WarplyManagerHelper {
// Methods
// ===========================================================
public static String getMarketPassMapUrl(Context context) {
public static String openSupermarketCampaign(Context context) {
// if (WarplyProperty.getAppUuid(context).equals("f83dfde1145e4c2da69793abb2f579af")) {
// return "https://dev.supermarketdeals.eu/map";
// }
//
// return "https://supermarketdeals.eu/map";
if (WarplyManagerHelper.getCampaignListAll() != null && !WarplyManagerHelper.getCampaignListAll().isEmpty()) {
for (Campaign smCampaign : WarplyManagerHelper.getCampaignListAll()) {
if (smCampaign.getOfferCategory().equals("more_for_you") && smCampaign.getFilter().equals("supermarket")) {
return WarplyManagerHelper.openSupermarketCampaign(smCampaign);
}
}
}
return "";
String url = "";
if (WarplyProperty.getAppUuid(context).equals("f83dfde1145e4c2da69793abb2f579af")) {
url = "https://dev.supermarketdeals.eu/map";
} else {
url = "https://supermarketdeals.eu/map";
}
/**
* Open Warply campaign
*/
public static String constructCampaignUrl(Campaign item) {
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("session_uuid", "");
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"));
......@@ -190,7 +170,10 @@ public class WarplyManagerHelper {
return url;
}
public static String openSupermarketCampaign(Campaign item) {
/**
* Open Warply campaign
*/
public static String constructCampaignUrl(Campaign item) {
WarplyManager.getSingleCampaign(item.getSessionUUID());
String url = item.getIndexUrl();
// + "?web_id=" + WarpUtils.getWebId(Warply.getWarplyContext())
......@@ -212,7 +195,6 @@ public class WarplyManagerHelper {
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("map", "map");
} catch (JSONException e) {
e.printStackTrace();
}
......