Class SwrveConversationCampaign

  • All Implemented Interfaces:
    java.io.Serializable

    public class SwrveConversationCampaign
    extends SwrveBaseCampaign
    implements java.io.Serializable
    See Also:
    Serialized Form
    • 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

      • 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 event
        payload - payload to compare conditions against
        now - device time
        qaCampaignInfoMap - will contain the reason the campaign showed or didn't show
        Returns:
        SwrveConversation message setup to the given trigger or null otherwise.
      • 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 class SwrveBaseCampaign
        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 class SwrveBaseCampaign
        Parameters:
        assetsOnDisk - All assets that are already downloaded.
        properties - String map of personalized properties.
        Returns:
        if the assets are ready