Package com.swrve.sdk.messaging
Class SwrveConversationCampaign
- java.lang.Object
-
- com.swrve.sdk.messaging.SwrveBaseCampaign
-
- com.swrve.sdk.messaging.SwrveConversationCampaign
-
- All Implemented Interfaces:
java.io.Serializable
public class SwrveConversationCampaign extends SwrveBaseCampaign implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected SwrveConversation
conversation
-
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, messageCenterDetails, minDelayBetweenMessage, name, priority, saveableState, showMessagesAfterLaunch, startDate, subject, triggers
-
-
Constructor Summary
Constructors Constructor Description SwrveConversationCampaign(ISwrveCampaignManager campaignManager, SwrveCampaignDisplayer campaignDisplayer, org.json.JSONObject campaignData, java.util.Set<com.swrve.sdk.SwrveAssetsQueueItem> assetsQueue)
-
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 SwrveConversation
createConversation(SwrveConversationCampaign swrveCampaign, org.json.JSONObject conversationData, ISwrveCampaignManager campaignManager)
com.swrve.sdk.QaCampaignInfo.CAMPAIGN_TYPE
getCampaignType()
Used by QAUser to determine what kind of campaign we are reportingSwrveConversation
getConversation()
SwrveConversation
getConversationForEvent(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)
Search for a conversation related to the given trigger event at the given time.boolean
supportsOrientation(com.swrve.sdk.messaging.SwrveOrientation orientation)
-
Methods inherited from class com.swrve.sdk.messaging.SwrveBaseCampaign
getDownloadDate, getEndDate, getId, getImpressions, getMaxImpressions, getMessageCenterDetails, getName, getPriority, getSaveableState, getShowMessagesAfterLaunch, getStartDate, getStatus, getSubject, getTriggers, incrementImpressions, isActive, isMessageCenter, messageWasShownToUser, setImpressions, setMessageCenterDetails, setMessageMinDelayThrottle, setSaveableState, setStatus
-
-
-
-
Field Detail
-
conversation
protected SwrveConversation conversation
-
-
Constructor Detail
-
SwrveConversationCampaign
public SwrveConversationCampaign(ISwrveCampaignManager campaignManager, SwrveCampaignDisplayer campaignDisplayer, org.json.JSONObject campaignData, java.util.Set<com.swrve.sdk.SwrveAssetsQueueItem> assetsQueue) throws org.json.JSONException
- Throws:
org.json.JSONException
-
-
Method Detail
-
getConversation
public SwrveConversation getConversation()
-
getConversationForEvent
public SwrveConversation getConversationForEvent(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)
Search for a conversation related to the given trigger event at the given time. This function will return null if too many messages were dismissed, the campaign start is in the future, the campaign end is in the past or the given event is not contained in the trigger set.- Parameters:
event
- trigger eventpayload
- payload to compare conditions againstnow
- device timeqaCampaignInfoMap
- will contain the reason the campaign showed or didn't show- Returns:
- SwrveConversation message setup to the given trigger or null otherwise.
-
createConversation
protected SwrveConversation createConversation(SwrveConversationCampaign swrveCampaign, org.json.JSONObject conversationData, ISwrveCampaignManager campaignManager) throws org.json.JSONException
- Throws:
org.json.JSONException
-
supportsOrientation
public boolean supportsOrientation(com.swrve.sdk.messaging.SwrveOrientation orientation)
- Specified by:
supportsOrientation
in classSwrveBaseCampaign
-
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
-
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
-
-