Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_android_sdk_maven_plugin
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Panagiotis Triantafyllou
2025-01-16 12:43:09 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
148e61939a15c50b31930a3c713117f4997bd97f
148e6193
1 parent
f38c8823
changes for cosmote pass fixes
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
30 deletions
warply_android_sdk/src/main/java/ly/warp/sdk/activities/MarketPassActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/MarketPassActivity.java
View file @
148e619
...
...
@@ -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
)
{
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
View file @
148e619
...
...
@@ -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
);
}
}
String
url
=
""
;
if
(
WarplyProperty
.
getAppUuid
(
context
).
equals
(
"f83dfde1145e4c2da69793abb2f579af"
))
{
url
=
"https://dev.supermarketdeals.eu/map"
;
}
else
{
url
=
"https://supermarketdeals.eu/map"
;
}
return
""
;
}
/**
* 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
();
}
...
...
Please
register
or
login
to post a comment