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
2022-07-14 11:59:57 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
78c8c258784c3ddd483838524c0dcba6341e30b6
78c8c258
1 parent
18021a17
minor fixes and additions
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
270 additions
and
74 deletions
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/Warply.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BaseFragmentActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/GiftsForYouActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/Campaign.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/NewCampaign.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/WarpView.java
warply_android_sdk/build.gradle
View file @
78c8c25
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4-cosbeta3
1i
'
PUBLISH_VERSION
=
'4.5.4-cosbeta3
2
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/Warply.java
View file @
78c8c25
This diff is collapsed. Click to expand it.
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BaseFragmentActivity.java
View file @
78c8c25
...
...
@@ -29,7 +29,9 @@ import ly.warp.sdk.io.models.CampaignList;
import
ly.warp.sdk.io.models.Consumer
;
import
ly.warp.sdk.io.models.CouponList
;
import
ly.warp.sdk.io.models.CouponsetsList
;
import
ly.warp.sdk.io.models.NewCampaignList
;
import
ly.warp.sdk.io.request.WarplyConsumerRequest
;
import
ly.warp.sdk.io.request.WarplyGetCampaignsRequest
;
import
ly.warp.sdk.io.request.WarplyGetCouponsetsRequest
;
import
ly.warp.sdk.io.request.WarplyInboxRequest
;
import
ly.warp.sdk.io.request.WarplyUserCouponsRequest
;
...
...
@@ -69,6 +71,7 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
if
(!
Thread
.
currentThread
().
isInterrupted
())
{
// WarplyManager.getConsumer(new WarplyConsumerRequest(), mConsumerReceiver);
Warply
.
getInbox
(
new
WarplyInboxRequest
().
setUseCache
(
false
),
mInboxReceiver
);
// WarplyManager.getCampaigns(new WarplyGetCampaignsRequest().setLanguage("el"), mCampaignsCallback);
}
}).
start
();
}
...
...
@@ -204,6 +207,18 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
}
};
private
CallbackReceiver
<
NewCampaignList
>
mCampaignsCallback
=
new
CallbackReceiver
<
NewCampaignList
>()
{
@Override
public
void
onSuccess
(
NewCampaignList
result
)
{
WarplyManager
.
getUserCouponsWithCouponsets
(
new
WarplyUserCouponsRequest
(),
mUserCouponsReceiver
);
}
@Override
public
void
onFailure
(
int
errorCode
)
{
Thread
.
currentThread
().
interrupt
();
}
};
private
final
CallbackReceiver
<
CouponList
>
mUserCouponsReceiver
=
new
CallbackReceiver
<
CouponList
>()
{
@Override
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/GiftsForYouActivity.java
View file @
78c8c25
...
...
@@ -182,6 +182,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
if
(
extraFields
.
has
(
"ccms_offer"
)
&&
extraFields
.
optString
(
"ccms_offer"
).
equals
(
"true"
))
{
for
(
LoyaltyContextualOfferModel
ccms
:
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
())
{
if
(
ccms
.
getLoyaltyCampaignId
().
equals
(
dataItem
.
getCampaign
().
getSessionUUID
()))
{
WarpUtils
.
log
(
"CCMS_CLICK "
+
ccms
.
toString
());
startActivity
(
WarpViewActivity
.
createIntentFromURL
(
this
,
WarplyManagerHelper
.
constructCcmsUrl
(
dataItem
.
getCampaign
(),
ccms
)));
break
;
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/Campaign.java
View file @
78c8c25
...
...
@@ -73,30 +73,30 @@ public class Campaign implements Parcelable, Serializable {
/* Member variables of the Campaign object */
private
final
int
action
;
private
final
double
delivered
;
private
int
action
;
private
double
delivered
;
private
double
expires
;
private
final
String
message
;
private
String
message
;
private
String
offerCategory
;
private
final
String
offerMessage
;
private
final
String
sessionUUID
;
private
final
double
starts
;
private
final
String
subtitle
;
private
final
String
title
;
private
final
int
sorting
;
private
final
int
opened
;
private
String
offerMessage
;
private
String
sessionUUID
;
private
double
starts
;
private
String
subtitle
;
private
String
title
;
private
int
sorting
;
private
int
opened
;
private
boolean
isNew
;
private
final
String
logoUrl
;
private
final
String
extraFields
;
private
final
String
type
;
private
final
boolean
expired
;
private
String
logoUrl
;
private
String
extraFields
;
private
String
type
;
private
boolean
expired
;
private
boolean
show
;
private
String
deliveryMethod
;
private
String
displayType
;
private
String
indexUrl
;
private
String
busId
;
private
ArrayList
<
CampaignAction
>
actions
=
new
ArrayList
<>();
private
final
String
campaignTypeSettings
;
private
String
campaignTypeSettings
;
/**
* Basic constructor used to create an object from a String, representing a
...
...
@@ -109,6 +109,33 @@ public class Campaign implements Parcelable, Serializable {
this
(
new
JSONObject
(
json
));
}
public
Campaign
()
{
this
.
action
=
0
;
this
.
delivered
=
0.0d
;
this
.
expires
=
0.0d
;
this
.
message
=
""
;
this
.
offerCategory
=
""
;
this
.
offerMessage
=
""
;
this
.
sessionUUID
=
""
;
this
.
starts
=
0.0d
;
this
.
subtitle
=
""
;
this
.
title
=
""
;
this
.
sorting
=
0
;
this
.
opened
=
0
;
this
.
isNew
=
true
;
this
.
logoUrl
=
""
;
this
.
extraFields
=
""
;
this
.
type
=
""
;
this
.
expired
=
false
;
this
.
show
=
true
;
this
.
deliveryMethod
=
""
;
this
.
displayType
=
""
;
this
.
indexUrl
=
""
;
this
.
busId
=
""
;
this
.
actions
=
new
ArrayList
<>();
this
.
campaignTypeSettings
=
""
;
}
/**
* Constructor used to create an Object from a given JSON Object
*
...
...
@@ -475,6 +502,94 @@ public class Campaign implements Parcelable, Serializable {
return
campaignTypeSettings
;
}
public
void
setExpires
(
double
expires
)
{
this
.
expires
=
expires
;
}
public
void
setOfferCategory
(
String
offerCategory
)
{
this
.
offerCategory
=
offerCategory
;
}
public
void
setShow
(
boolean
show
)
{
this
.
show
=
show
;
}
public
void
setDeliveryMethod
(
String
deliveryMethod
)
{
this
.
deliveryMethod
=
deliveryMethod
;
}
public
void
setDisplayType
(
String
displayType
)
{
this
.
displayType
=
displayType
;
}
public
void
setIndexUrl
(
String
indexUrl
)
{
this
.
indexUrl
=
indexUrl
;
}
public
void
setActions
(
ArrayList
<
CampaignAction
>
actions
)
{
this
.
actions
=
actions
;
}
public
void
setAction
(
int
action
)
{
this
.
action
=
action
;
}
public
void
setDelivered
(
double
delivered
)
{
this
.
delivered
=
delivered
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
public
void
setOfferMessage
(
String
offerMessage
)
{
this
.
offerMessage
=
offerMessage
;
}
public
void
setSessionUUID
(
String
sessionUUID
)
{
this
.
sessionUUID
=
sessionUUID
;
}
public
void
setStarts
(
double
starts
)
{
this
.
starts
=
starts
;
}
public
void
setSubtitle
(
String
subtitle
)
{
this
.
subtitle
=
subtitle
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
void
setSorting
(
int
sorting
)
{
this
.
sorting
=
sorting
;
}
public
void
setOpened
(
int
opened
)
{
this
.
opened
=
opened
;
}
public
void
setLogoUrl
(
String
logoUrl
)
{
this
.
logoUrl
=
logoUrl
;
}
public
void
setExtraFields
(
String
extraFields
)
{
this
.
extraFields
=
extraFields
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
void
setExpired
(
boolean
expired
)
{
this
.
expired
=
expired
;
}
public
void
setCampaignTypeSettings
(
String
campaignTypeSettings
)
{
this
.
campaignTypeSettings
=
campaignTypeSettings
;
}
@Override
public
int
describeContents
()
{
return
0
;
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/NewCampaign.java
View file @
78c8c25
...
...
@@ -69,12 +69,12 @@ public class NewCampaign implements Parcelable, Serializable {
/* Member variables of the Campaign object */
private
final
String
campaignType
;
private
final
String
settings
;
private
JSONObject
settings
=
new
JSONObject
()
;
private
final
String
audience
;
private
final
String
deliveryMethod
;
private
final
String
displayType
;
private
final
String
extraFields
;
private
final
String
workflowSettings
;
private
JSONObject
extraFields
=
new
JSONObject
()
;
private
JSONObject
workflowSettings
=
new
JSONObject
()
;
private
final
String
category
;
private
final
int
sorting
;
private
final
String
indexUrl
;
...
...
@@ -115,13 +115,13 @@ public class NewCampaign implements Parcelable, Serializable {
this
.
category
=
json
.
optString
(
CATEGORY
);
this
.
title
=
json
.
optString
(
TITLE
);
this
.
sorting
=
json
.
optInt
(
SORTING
);
this
.
extraFields
=
json
.
opt
String
(
EXTRA_FIELDS
);
this
.
extraFields
=
json
.
opt
JSONObject
(
EXTRA_FIELDS
);
this
.
campaignType
=
json
.
optString
(
CAMPAIGN_TYPE
);
this
.
deliveryMethod
=
json
.
optString
(
DELIVERY_METHOD
);
this
.
displayType
=
json
.
optString
(
DISPLAY_TYPE
);
this
.
settings
=
json
.
opt
String
(
SETTINGS
);
this
.
settings
=
json
.
opt
JSONObject
(
SETTINGS
);
this
.
audience
=
json
.
optString
(
AUDIENCE
);
this
.
workflowSettings
=
json
.
opt
String
(
WORKFLOW_SETTINGS
);
this
.
workflowSettings
=
json
.
opt
JSONObject
(
WORKFLOW_SETTINGS
);
this
.
description
=
json
.
optString
(
DESCRIPTION
);
this
.
startDate
=
json
.
optString
(
START_DATE
);
this
.
endDate
=
json
.
optString
(
END_DATE
);
...
...
@@ -140,12 +140,12 @@ public class NewCampaign implements Parcelable, Serializable {
this
.
sorting
=
source
.
readInt
();
this
.
isNew
=
source
.
readByte
()
!=
0
;
this
.
logoUrl
=
source
.
readString
();
this
.
extraFields
=
source
.
readString
();
//
this.extraFields = source.readString();
this
.
deliveryMethod
=
source
.
readString
();
this
.
displayType
=
source
.
readString
();
this
.
settings
=
source
.
readString
();
//
this.settings = source.readString();
this
.
audience
=
source
.
readString
();
this
.
workflowSettings
=
source
.
readString
();
//
this.workflowSettings = source.readString();
this
.
description
=
source
.
readString
();
this
.
startDate
=
source
.
readString
();
this
.
endDate
=
source
.
readString
();
...
...
@@ -164,12 +164,12 @@ public class NewCampaign implements Parcelable, Serializable {
dest
.
writeInt
(
this
.
sorting
);
dest
.
writeInt
(
this
.
isNew
?
1
:
0
);
dest
.
writeString
(
this
.
logoUrl
);
dest
.
writeString
(
extraFields
);
//
dest.writeString(extraFields);
dest
.
writeString
(
deliveryMethod
);
dest
.
writeString
(
displayType
);
dest
.
writeString
(
this
.
settings
);
//
dest.writeString(this.settings);
dest
.
writeString
(
this
.
audience
);
dest
.
writeString
(
this
.
workflowSettings
);
//
dest.writeString(this.workflowSettings);
dest
.
writeString
(
this
.
description
);
dest
.
writeString
(
this
.
startDate
);
dest
.
writeString
(
this
.
endDate
);
...
...
@@ -295,10 +295,6 @@ public class NewCampaign implements Parcelable, Serializable {
return
indexUrl
;
}
public
String
getExtraFields
()
{
return
extraFields
;
}
public
String
getDeliveryMethod
()
{
return
deliveryMethod
;
}
...
...
@@ -311,18 +307,10 @@ public class NewCampaign implements Parcelable, Serializable {
return
campaignType
;
}
public
String
getSettings
()
{
return
settings
;
}
public
String
getAudience
()
{
return
audience
;
}
public
String
getWorkflowSettings
()
{
return
workflowSettings
;
}
public
String
getCategory
()
{
return
category
;
}
...
...
@@ -355,6 +343,18 @@ public class NewCampaign implements Parcelable, Serializable {
return
isNew
;
}
public
JSONObject
getSettings
()
{
return
settings
;
}
public
JSONObject
getExtraFields
()
{
return
extraFields
;
}
public
JSONObject
getWorkflowSettings
()
{
return
workflowSettings
;
}
@Override
public
int
describeContents
()
{
return
0
;
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
View file @
78c8c25
...
...
@@ -28,6 +28,8 @@ package ly.warp.sdk.utils.managers;
import
org.json.JSONException
;
import
org.json.JSONObject
;
import
java.util.ArrayList
;
import
ly.warp.sdk.Warply
;
import
ly.warp.sdk.activities.BaseFragmentActivity
;
import
ly.warp.sdk.db.WarplyDBHelper
;
...
...
@@ -48,6 +50,8 @@ import ly.warp.sdk.io.callbacks.TagsCategoriesHook;
import
ly.warp.sdk.io.callbacks.TagsHook
;
import
ly.warp.sdk.io.callbacks.TransactionsHook
;
import
ly.warp.sdk.io.models.AddressList
;
import
ly.warp.sdk.io.models.Campaign
;
import
ly.warp.sdk.io.models.CampaignList
;
import
ly.warp.sdk.io.models.Card
;
import
ly.warp.sdk.io.models.CardList
;
import
ly.warp.sdk.io.models.Consumer
;
...
...
@@ -58,6 +62,7 @@ import ly.warp.sdk.io.models.Couponset;
import
ly.warp.sdk.io.models.CouponsetsList
;
import
ly.warp.sdk.io.models.MerchantCategoriesList
;
import
ly.warp.sdk.io.models.MerchantList
;
import
ly.warp.sdk.io.models.NewCampaign
;
import
ly.warp.sdk.io.models.NewCampaignList
;
import
ly.warp.sdk.io.models.PacingDetails
;
import
ly.warp.sdk.io.models.PointsList
;
...
...
@@ -118,6 +123,7 @@ import ly.warp.sdk.utils.constants.WarpConstants;
*/
public
class
WarplyManager
{
private
static
NewCampaignList
mNewCampaignList
=
new
NewCampaignList
();
public
static
void
getProducts
(
WarplyProductsRequest
request
,
final
CallbackReceiver
<
ProductList
>
receiver
)
{
// String productCategory = "";
...
...
@@ -1318,38 +1324,97 @@ public class WarplyManager {
});
}
public
static
void
getCampaigns
(
WarplyGetCampaignsRequest
request
,
boolean
auth
,
final
CallbackReceiver
<
NewCampaignList
>
receiver
)
{
public
static
void
getCampaigns
(
WarplyGetCampaignsRequest
request
,
final
CallbackReceiver
<
NewCampaignList
>
receiver
)
{
WarpUtils
.
log
(
"************* WARPLY Get Campaigns Request ********************"
);
WarpUtils
.
log
(
"[WARP Trace] WARPLY Get Campaigns Request is active"
);
WarpUtils
.
log
(
"**************************************************"
);
Warply
.
postReceiveMicroappData
(
WarpConstants
.
MICROAPP_NEW_CAMPAIGNS
,
false
,
"campaigns"
,
request
.
toJson
(),
new
NewCampaignsHook
(
new
CallbackReceiver
<
NewCampaignList
>()
{
@Override
public
void
onSuccess
(
NewCampaignList
result
)
{
// receiver.onSuccess(result);
mNewCampaignList
.
clear
();
mNewCampaignList
.
addAll
(
result
);
getCampaignsPersonalized
(
request
,
new
CallbackReceiver
<
NewCampaignList
>()
{
@Override
public
void
onSuccess
(
NewCampaignList
resultPersonalized
)
{
receiver
.
onSuccess
(
resultPersonalized
);
}
@Override
public
void
onFailure
(
int
errorCode
)
{
receiver
.
onFailure
(
errorCode
);
}
});
}
@Override
public
void
onFailure
(
int
errorCode
)
{
receiver
.
onFailure
(
errorCode
);
}
},
request
.
getSignature
()));
}
public
static
void
getCampaignsPersonalized
(
WarplyGetCampaignsRequest
request
,
final
CallbackReceiver
<
NewCampaignList
>
receiver
)
{
WarpUtils
.
log
(
"************* WARPLY Get Campaigns Request ********************"
);
WarpUtils
.
log
(
"[WARP Trace] WARPLY Get Campaigns Request is active"
);
WarpUtils
.
log
(
"**************************************************"
);
Warply
.
postReceiveMicroappData
(
WarpConstants
.
MICROAPP_NEW_CAMPAIGNS
,
auth
,
"campaigns
"
,
request
.
toJson
(),
new
NewCampaignsHook
(
new
CallbackReceiver
<
NewCampaignList
>()
{
Warply
.
postReceiveMicroappData
(
WarpConstants
.
MICROAPP_NEW_CAMPAIGNS
,
true
,
"campaignsPersonalized
"
,
request
.
toJson
(),
new
NewCampaignsHook
(
new
CallbackReceiver
<
NewCampaignList
>()
{
@Override
public
void
onSuccess
(
NewCampaignList
result
)
{
mNewCampaignList
.
addAll
(
result
);
CampaignList
tempCampaigns
=
new
CampaignList
();
for
(
NewCampaign
newCamp
:
mNewCampaignList
)
{
Campaign
camp
=
new
Campaign
();
camp
.
setIndexUrl
(
newCamp
.
getIndexUrl
());
camp
.
setLogoUrl
(
newCamp
.
getLogoUrl
());
camp
.
setMessage
(
newCamp
.
getMessage
());
camp
.
setOfferCategory
(
newCamp
.
getCommunicationCategory
());
camp
.
setSessionUUID
(
newCamp
.
getCommunicationUUID
());
camp
.
setTitle
(
newCamp
.
getTitle
());
camp
.
setSubtitle
(
newCamp
.
getSubtitle
());
camp
.
setSorting
(
newCamp
.
getSorting
());
camp
.
setNew
(
newCamp
.
getIsNew
());
camp
.
setType
(
newCamp
.
getCampaignType
());
try
{
camp
.
setExtraFields
(
newCamp
.
getExtraFields
().
toString
());
}
catch
(
NullPointerException
e
)
{
camp
.
setExtraFields
(
""
);
e
.
printStackTrace
();
}
try
{
camp
.
setCampaignTypeSettings
(
newCamp
.
getSettings
().
toString
());
}
catch
(
NullPointerException
e
)
{
camp
.
setCampaignTypeSettings
(
""
);
e
.
printStackTrace
();
}
tempCampaigns
.
add
(
camp
);
}
WarplyManagerHelper
.
setCampaignList
(
tempCampaigns
);
receiver
.
onSuccess
(
result
);
}
@Override
public
void
onFailure
(
int
errorCode
)
{
if
(
auth
)
{
if
(
errorCode
==
401
)
{
refreshToken
(
new
WarplyRefreshTokenRequest
(),
new
CallbackReceiver
<
JSONObject
>()
{
@Override
public
void
onSuccess
(
JSONObject
result
)
{
int
status
=
result
.
optInt
(
"status"
,
2
);
if
(
status
==
1
)
getCampaigns
(
request
,
auth
,
receiver
);
else
receiver
.
onFailure
(
status
);
}
if
(
errorCode
==
401
)
{
refreshToken
(
new
WarplyRefreshTokenRequest
(),
new
CallbackReceiver
<
JSONObject
>()
{
@Override
public
void
onSuccess
(
JSONObject
result
)
{
int
status
=
result
.
optInt
(
"status"
,
2
);
if
(
status
==
1
)
getCampaignsPersonalized
(
request
,
receiver
);
else
receiver
.
onFailure
(
status
);
}
@Override
public
void
onFailure
(
int
errorCode
)
{
receiver
.
onFailure
(
errorCode
);
}
});
}
else
receiver
.
onFailure
(
errorCode
);
@Override
public
void
onFailure
(
int
errorCode
)
{
receiver
.
onFailure
(
errorCode
);
}
});
}
else
receiver
.
onFailure
(
errorCode
);
}
...
...
@@ -1554,7 +1619,7 @@ public class WarplyManager {
WarpUtils
.
log
(
"[WARP Trace] WARPLY User Coupons Request is active"
);
WarpUtils
.
log
(
"**************************************************"
);
WarplyManager
.
getCouponsets
(
new
WarplyGetCouponsetsRequest
()
getCouponsets
(
new
WarplyGetCouponsetsRequest
()
.
setLanguage
(
WarplyProperty
.
getLanguage
(
Warply
.
getWarplyContext
())),
new
CallbackReceiver
<
CouponsetsList
>()
{
@Override
public
void
onSuccess
(
CouponsetsList
result
)
{
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/WarpView.java
View file @
78c8c25
...
...
@@ -383,19 +383,6 @@ public class WarpView extends WebView {
questionnaireEvent
.
setName
(
parts
[
1
]);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
questionnaireEvent
));
}
else
if
(
parts
[
1
].
equals
(
"userAnswered"
))
{
QuestionnaireEventModel
questionnaireEvent
=
new
QuestionnaireEventModel
();
try
{
questionnaireEvent
.
setName
(
parts
[
1
]);
questionnaireEvent
.
setParameter
(
parts
[
2
]);
WarpUtils
.
setUserTag
(
Warply
.
getWarplyContext
(),
parts
[
2
]);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
questionnaireEvent
));
}
catch
(
IndexOutOfBoundsException
e
)
{
questionnaireEvent
.
setName
(
parts
[
1
]);
questionnaireEvent
.
setParameter
(
""
);
WarpUtils
.
setUserTag
(
Warply
.
getWarplyContext
(),
""
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
questionnaireEvent
));
}
}
else
if
(
parts
[
1
].
equals
(
"addUserTag"
))
{
// QuestionnaireEventModel questionnaireEvent = new QuestionnaireEventModel();
try
{
// questionnaireEvent.setName(parts[1]);
...
...
@@ -408,6 +395,19 @@ public class WarpView extends WebView {
WarpUtils
.
setUserTag
(
Warply
.
getWarplyContext
(),
""
);
// EventBus.getDefault().post(new WarplyEventBusManager(questionnaireEvent));
}
}
else
if
(
parts
[
1
].
equals
(
"addUserTag"
))
{
QuestionnaireEventModel
questionnaireEvent
=
new
QuestionnaireEventModel
();
try
{
questionnaireEvent
.
setName
(
parts
[
1
]);
questionnaireEvent
.
setParameter
(
parts
[
2
]);
WarpUtils
.
setUserTag
(
Warply
.
getWarplyContext
(),
parts
[
2
]);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
questionnaireEvent
));
}
catch
(
IndexOutOfBoundsException
e
)
{
questionnaireEvent
.
setName
(
parts
[
1
]);
questionnaireEvent
.
setParameter
(
""
);
WarpUtils
.
setUserTag
(
Warply
.
getWarplyContext
(),
""
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
questionnaireEvent
));
}
}
else
if
(
parts
[
1
].
equals
(
"couponRetrieved"
))
{
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
new
CouponEventModel
()));
}
else
if
(
parts
[
1
].
equals
(
"couponShared"
))
{
...
...
Please
register
or
login
to post a comment