Showing
2 changed files
with
12 additions
and
30 deletions
| ... | @@ -102,7 +102,7 @@ public class MarketPassActivity extends Activity implements View.OnClickListener | ... | @@ -102,7 +102,7 @@ public class MarketPassActivity extends Activity implements View.OnClickListener |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | WarplyAnalyticsManager.logTrackersEvent(this, "click", "MarketPassInfoScreen"); | 104 | WarplyAnalyticsManager.logTrackersEvent(this, "click", "MarketPassInfoScreen"); |
| 105 | - startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.getMarketPassMapUrl(MarketPassActivity.this))); | 105 | + startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.openSupermarketCampaign(MarketPassActivity.this))); |
| 106 | } | 106 | } |
| 107 | } | 107 | } |
| 108 | if (view.getId() == R.id.iv_coupons_info) { | 108 | if (view.getId() == R.id.iv_coupons_info) { | ... | ... |
| ... | @@ -137,46 +137,26 @@ public class WarplyManagerHelper { | ... | @@ -137,46 +137,26 @@ public class WarplyManagerHelper { |
| 137 | // Methods | 137 | // Methods |
| 138 | // =========================================================== | 138 | // =========================================================== |
| 139 | 139 | ||
| 140 | - public static String getMarketPassMapUrl(Context context) { | 140 | + public static String openSupermarketCampaign(Context context) { |
| 141 | // if (WarplyProperty.getAppUuid(context).equals("f83dfde1145e4c2da69793abb2f579af")) { | 141 | // if (WarplyProperty.getAppUuid(context).equals("f83dfde1145e4c2da69793abb2f579af")) { |
| 142 | // return "https://dev.supermarketdeals.eu/map"; | 142 | // return "https://dev.supermarketdeals.eu/map"; |
| 143 | // } | 143 | // } |
| 144 | // | 144 | // |
| 145 | // return "https://supermarketdeals.eu/map"; | 145 | // return "https://supermarketdeals.eu/map"; |
| 146 | 146 | ||
| 147 | - | 147 | + String url = ""; |
| 148 | - if (WarplyManagerHelper.getCampaignListAll() != null && !WarplyManagerHelper.getCampaignListAll().isEmpty()) { | 148 | + if (WarplyProperty.getAppUuid(context).equals("f83dfde1145e4c2da69793abb2f579af")) { |
| 149 | - for (Campaign smCampaign : WarplyManagerHelper.getCampaignListAll()) { | 149 | + url = "https://dev.supermarketdeals.eu/map"; |
| 150 | - if (smCampaign.getOfferCategory().equals("more_for_you") && smCampaign.getFilter().equals("supermarket")) { | 150 | + } else { |
| 151 | - return WarplyManagerHelper.openSupermarketCampaign(smCampaign); | 151 | + url = "https://supermarketdeals.eu/map"; |
| 152 | - } | ||
| 153 | - } | ||
| 154 | } | 152 | } |
| 155 | 153 | ||
| 156 | - return ""; | ||
| 157 | - } | ||
| 158 | - | ||
| 159 | - /** | ||
| 160 | - * Open Warply campaign | ||
| 161 | - */ | ||
| 162 | - public static String constructCampaignUrl(Campaign item) { | ||
| 163 | - WarplyManager.getSingleCampaign(item.getSessionUUID()); | ||
| 164 | - String url = item.getIndexUrl(); | ||
| 165 | -// + "?web_id=" + WarpUtils.getWebId(Warply.getWarplyContext()) | ||
| 166 | -// + "&app_uuid=" + WarplyProperty.getAppUuid(Warply.getWarplyContext()) | ||
| 167 | -// + "&api_key=" + WarpUtils.getApiKey(Warply.getWarplyContext()) | ||
| 168 | -// + "&session_uuid=" + item.getSessionUUID() | ||
| 169 | -// + "&access_token=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("access_token") | ||
| 170 | -// + "&refresh_token=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("refresh_token") | ||
| 171 | -// + "&client_id=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_id") | ||
| 172 | -// + "&client_secret=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_secret"); | ||
| 173 | - | ||
| 174 | JSONObject params = new JSONObject(); | 154 | JSONObject params = new JSONObject(); |
| 175 | try { | 155 | try { |
| 176 | params.putOpt("web_id", WarpUtils.getWebId(Warply.getWarplyContext())); | 156 | params.putOpt("web_id", WarpUtils.getWebId(Warply.getWarplyContext())); |
| 177 | params.putOpt("app_uuid", WarplyProperty.getAppUuid(Warply.getWarplyContext())); | 157 | params.putOpt("app_uuid", WarplyProperty.getAppUuid(Warply.getWarplyContext())); |
| 178 | params.putOpt("api_key", WarpUtils.getApiKey(Warply.getWarplyContext())); | 158 | params.putOpt("api_key", WarpUtils.getApiKey(Warply.getWarplyContext())); |
| 179 | - params.putOpt("session_uuid", item.getSessionUUID()); | 159 | + params.putOpt("session_uuid", ""); |
| 180 | params.putOpt("access_token", WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("access_token")); | 160 | params.putOpt("access_token", WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("access_token")); |
| 181 | params.putOpt("refresh_token", WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("refresh_token")); | 161 | params.putOpt("refresh_token", WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("refresh_token")); |
| 182 | params.putOpt("client_id", WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_id")); | 162 | params.putOpt("client_id", WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_id")); |
| ... | @@ -190,7 +170,10 @@ public class WarplyManagerHelper { | ... | @@ -190,7 +170,10 @@ public class WarplyManagerHelper { |
| 190 | return url; | 170 | return url; |
| 191 | } | 171 | } |
| 192 | 172 | ||
| 193 | - public static String openSupermarketCampaign(Campaign item) { | 173 | + /** |
| 174 | + * Open Warply campaign | ||
| 175 | + */ | ||
| 176 | + public static String constructCampaignUrl(Campaign item) { | ||
| 194 | WarplyManager.getSingleCampaign(item.getSessionUUID()); | 177 | WarplyManager.getSingleCampaign(item.getSessionUUID()); |
| 195 | String url = item.getIndexUrl(); | 178 | String url = item.getIndexUrl(); |
| 196 | // + "?web_id=" + WarpUtils.getWebId(Warply.getWarplyContext()) | 179 | // + "?web_id=" + WarpUtils.getWebId(Warply.getWarplyContext()) |
| ... | @@ -212,7 +195,6 @@ public class WarplyManagerHelper { | ... | @@ -212,7 +195,6 @@ public class WarplyManagerHelper { |
| 212 | params.putOpt("refresh_token", WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("refresh_token")); | 195 | params.putOpt("refresh_token", WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("refresh_token")); |
| 213 | params.putOpt("client_id", WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_id")); | 196 | params.putOpt("client_id", WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_id")); |
| 214 | params.putOpt("client_secret", WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_secret")); | 197 | params.putOpt("client_secret", WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_secret")); |
| 215 | - params.putOpt("map", "map"); | ||
| 216 | } catch (JSONException e) { | 198 | } catch (JSONException e) { |
| 217 | e.printStackTrace(); | 199 | e.printStackTrace(); |
| 218 | } | 200 | } | ... | ... |
-
Please register or login to post a comment