Class SwrveMessage

  • All Implemented Interfaces:
    SwrveBaseMessage

    public class SwrveMessage
    extends java.lang.Object
    implements SwrveBaseMessage
    In-app message inside a campaign, with different formats.
    • 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

      • getCacheDir

        public java.io.File getCacheDir()
      • 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 interface SwrveBaseMessage
        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 disk
        properties - properties are used to resolve the dynamic image urls that may occur
        Returns:
        true if all assets for this message have been downloaded.