Package com.swrve.sdk.messaging
Class SwrveEmbeddedCampaign
- java.lang.Object
-
- com.swrve.sdk.messaging.SwrveBaseCampaign
-
- com.swrve.sdk.messaging.SwrveEmbeddedCampaign
-
public class SwrveEmbeddedCampaign extends SwrveBaseCampaign
-
-
Field Summary
Fields Modifier and Type Field Description protected SwrveEmbeddedMessage
message
-
Fields inherited from class com.swrve.sdk.messaging.SwrveBaseCampaign
campaignDisplayer, campaignManager, DEFAULT_DELAY_FIRST_MESSAGE, DEFAULT_MAX_IMPRESSIONS, DEFAULT_MIN_DELAY_BETWEEN_MSGS, endDate, id, maxImpressions, messageCenter, minDelayBetweenMessage, name, saveableState, showMessagesAfterLaunch, startDate, subject, triggers
-
-
Constructor Summary
Constructors Constructor Description SwrveEmbeddedCampaign(ISwrveCampaignManager campaignManager, SwrveCampaignDisplayer campaignDisplayer, org.json.JSONObject campaignData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
areAssetsReady(java.util.Set<java.lang.String> assetsOnDisk, java.util.Map<java.lang.String,java.lang.String> properties)
Determine if the assets for this campaign have been downloaded.protected SwrveEmbeddedMessage
createMessage(SwrveEmbeddedCampaign swrveCampaign, org.json.JSONObject messageData)
com.swrve.sdk.QaCampaignInfo.CAMPAIGN_TYPE
getCampaignType()
Used by QAUser to determine what kind of campaign we are reportingSwrveEmbeddedMessage
getMessage()
SwrveEmbeddedMessage
getMessageForEvent(java.lang.String event, java.util.Map<java.lang.String,java.lang.String> payload, java.util.Date now, java.util.Map<java.lang.Integer,com.swrve.sdk.QaCampaignInfo> qaCampaignInfoMap)
boolean
supportsOrientation(com.swrve.sdk.messaging.SwrveOrientation orientation)
-
Methods inherited from class com.swrve.sdk.messaging.SwrveBaseCampaign
getEndDate, getId, getImpressions, getMaxImpressions, getName, getSaveableState, getShowMessagesAfterLaunch, getStartDate, getStatus, getSubject, getTriggers, incrementImpressions, isActive, isMessageCenter, messageWasShownToUser, setImpressions, setMessageMinDelayThrottle, setSaveableState, setStatus
-
-
-
-
Field Detail
-
message
protected SwrveEmbeddedMessage message
-
-
Constructor Detail
-
SwrveEmbeddedCampaign
public SwrveEmbeddedCampaign(ISwrveCampaignManager campaignManager, SwrveCampaignDisplayer campaignDisplayer, org.json.JSONObject campaignData) throws org.json.JSONException
- Throws:
org.json.JSONException
-
-
Method Detail
-
supportsOrientation
public boolean supportsOrientation(com.swrve.sdk.messaging.SwrveOrientation orientation)
- Specified by:
supportsOrientation
in classSwrveBaseCampaign
-
areAssetsReady
public boolean areAssetsReady(java.util.Set<java.lang.String> assetsOnDisk, java.util.Map<java.lang.String,java.lang.String> properties)
Description copied from class:SwrveBaseCampaign
Determine if the assets for this campaign have been downloaded.- Specified by:
areAssetsReady
in classSwrveBaseCampaign
- Parameters:
assetsOnDisk
- All assets that are already downloaded.properties
- String map of personalized properties.- Returns:
- if the assets are ready
-
getCampaignType
public com.swrve.sdk.QaCampaignInfo.CAMPAIGN_TYPE getCampaignType()
Description copied from class:SwrveBaseCampaign
Used by QAUser to determine what kind of campaign we are reporting- Specified by:
getCampaignType
in classSwrveBaseCampaign
- Returns:
- CAMPAIGN_TYPE enum
-
createMessage
protected SwrveEmbeddedMessage createMessage(SwrveEmbeddedCampaign swrveCampaign, org.json.JSONObject messageData) throws org.json.JSONException
- Throws:
org.json.JSONException
-
getMessage
public SwrveEmbeddedMessage getMessage()
-
getMessageForEvent
public SwrveEmbeddedMessage getMessageForEvent(java.lang.String event, java.util.Map<java.lang.String,java.lang.String> payload, java.util.Date now, java.util.Map<java.lang.Integer,com.swrve.sdk.QaCampaignInfo> qaCampaignInfoMap)
- Parameters:
event
- trigger eventpayload
- payload to compare conditions againstnow
- device timeqaCampaignInfoMap
- will contain the reason the campaign wasn't triggered- Returns:
- SwrveEmbeddedMessage message setup to the given trigger or null otherwise.
-
-