Package com.swrve.sdk.messaging
Class SwrveMessage
- java.lang.Object
-
- com.swrve.sdk.messaging.SwrveMessage
-
- All Implemented Interfaces:
SwrveBaseMessage
public class SwrveMessage extends java.lang.Object implements SwrveBaseMessage
In-app message inside a campaign, with different formats.
-
-
Constructor Summary
Constructors Constructor Description SwrveMessage(SwrveInAppCampaign campaign, org.json.JSONObject messageData, java.io.File cacheDir)
-
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)
Checks if assets have been downloaded.protected boolean
assetInCache(java.util.Set<java.lang.String> assetsOnDisk, java.lang.String asset)
java.io.File
getCacheDir()
SwrveInAppCampaign
getCampaign()
SwrveMessageFormat
getFormat(com.swrve.sdk.messaging.SwrveOrientation orientation)
Search for a format with the given orientation.java.util.List<SwrveMessageFormat>
getFormats()
int
getId()
SwrveMessageCenterDetails
getMessageCenterDetails()
java.lang.String
getName()
int
getPriority()
boolean
isControl()
boolean
supportsOrientation(com.swrve.sdk.messaging.SwrveOrientation orientation)
Returns true if the message has a format for the given orientation.
-
-
-
Constructor Detail
-
SwrveMessage
public SwrveMessage(SwrveInAppCampaign campaign, org.json.JSONObject messageData, java.io.File cacheDir) throws org.json.JSONException
- Throws:
org.json.JSONException
-
-
Method Detail
-
isControl
public boolean isControl()
- Specified by:
isControl
in interfaceSwrveBaseMessage
-
getId
public int getId()
- Specified by:
getId
in interfaceSwrveBaseMessage
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceSwrveBaseMessage
-
getPriority
public int getPriority()
- Specified by:
getPriority
in interfaceSwrveBaseMessage
-
getFormats
public java.util.List<SwrveMessageFormat> getFormats()
-
getCacheDir
public java.io.File getCacheDir()
-
getCampaign
public SwrveInAppCampaign getCampaign()
- Specified by:
getCampaign
in interfaceSwrveBaseMessage
-
getMessageCenterDetails
public SwrveMessageCenterDetails getMessageCenterDetails()
-
getFormat
public SwrveMessageFormat getFormat(com.swrve.sdk.messaging.SwrveOrientation orientation)
Search for a format with the given orientation.- Parameters:
orientation
- Portrait, Landscape or Both.- Returns:
- SwrveMessageFormat Message format for the specified orientation.
-
supportsOrientation
public boolean supportsOrientation(com.swrve.sdk.messaging.SwrveOrientation orientation)
Returns true if the message has a format for the given orientation.- Specified by:
supportsOrientation
in interfaceSwrveBaseMessage
- Parameters:
orientation
- A SwrveOrientation- Returns:
- true if the message supports the given orientation.
-
assetInCache
protected boolean assetInCache(java.util.Set<java.lang.String> assetsOnDisk, java.lang.String asset)
-
areAssetsReady
public boolean areAssetsReady(java.util.Set<java.lang.String> assetsOnDisk, java.util.Map<java.lang.String,java.lang.String> properties)
Checks if assets have been downloaded.- Parameters:
assetsOnDisk
- Already downloaded assets on diskproperties
- properties are used to resolve the dynamic image urls that may occur- Returns:
- true if all assets for this message have been downloaded.
-
-