Campaigns

SyneriseSource

This enum contains values which describe the source of campaign.

Declared In:
com.synerise.sdk.injector.callback.SyneriseSource

Declaration:

public enum SyneriseSource
public enum SyneriseSource

Values:

Property Description
SIMPLE_PUSH Simple push campaign
IN_APP_MESSAGE Overlay in-app message campaign
INLINE_IN_APP_MESSAGE Inline in-app message campaign


Campaign

Class model for campaigns.

Declared In:
com.synerise.sdk.injector.net.model.Campaign

Declaration:

public class Campaign implements Serializable
class Campaign : Serializable

Properties:

Property Type Optional Default Description
hashId String no - Campaign hash ID
variantId int no - Campaign variant's ID
title String no - Campaign title
type String no - Campaign type

NOTE: All the properties above are accessible by using getters.

Initializers:

There are no initializers.

Methods:

This method retrieves a value for the hashId parameter.

public String getHashId()

This method retrieves a value for the variantId parameter.

public int getVariantId()

This method retrieves a value for the title parameter.

public String getTitle()

This method retrieves a value for the type parameter.

public String getType()



SimpleNotification

Class model for simple notification.

Declared In:
com.synerise.sdk.injector.net.model.push.notification.SimpleNotification

Declaration:

public class SimpleNotification implements Serializable
class SimpleNotification : Serializable

Properties:

Property Type Optional Default Description
title String no - Notification title
body String no - Notification body

NOTE: All the properties above are accessible by using getters.

Initializers:

There are no initializers.

Methods:

This method checks if the notification has a title.

public boolean hasTitle()

This method retrieves a value for the title parameter (notification title).

public String getTitle()

This method checks if the notification has a body.

public boolean hasBody()

This method retrieves a value for the body parameter (notification body).

public String getBody()



NotificationInfo

Model with information about a Synerise push notification delivered to OnNotificationListener

Declared In:
com.synerise.sdk.injector.callback.model.NotificationInfo

Declaration:

public class NotificationInfo
public class NotificationInfo

Values

Property Type Optional Default Description
campaignHashId String no - Identifier of the notification campaign.
campaignTitle String no - Title of the notification campaign.
payload HashMap<String, String> no - Payload of the notification.

Initializers:

Constructor:

public NotificationInfo(String hashId, String title, HashMap<String, String> payload)

Methods:

This method retrieves the value of the campaignHashId parameter.

public String getCampaignHashId()

This method defines the value of the campaignHashId parameter.

public void setCampaignHashId(String campaignHashId)

This method retrieves the value of the CampaignTitle parameter.

public String getCampaignTitle()

This method defines the value of the CampaignTitle parameter.

public void setCampaignTitle(String campaignTitle)

This method retrieves the contents of the payload parameter.

public HashMap<String, String> getPayload()

This method defines the contents of the payload parameter.

public void setPayload(HashMap<String, String> payload)



PushRegistrationOrigin

This enum contains values for the origin parameter of push registration listener methods.

Declared In:
com.synerise.sdk.core.types.enums

Declaration:

public enum PushRegistrationOrigin
public enum PushRegistrationOrigin

Values:

Property Value Description
APP_STARTED "APP_STARTED" After a client.applicationStarted event is sent.
CLIENT_CONTEXT_CHANGE "CLIENT_CONTEXT_CHANGE" After the client context changes.
PERIODIC_JOB "PERIODIC_JOB" After a periodic job of a background task starts.
SECURITY_REASON "SECURITY_REASON" After a security threat

Methods:
There are no methods.




SilentCommand

Class model for silent command.

Declared In:
com.synerise.sdk.injector.SilentCommand

Declaration:

public class SilentCommand implements Validable
class SilentCommand : Validable

Properties:

Property Type Optional Default Description
className String no - Class name
methodName String no - Method name
methodParameterList List<MethodParameter> no - Method parameters

NOTE: All the properties above are accessible by using getters.

Initializers:

There are no initializers.

Methods:

This method retrieves a value of the className parameter.

public String getClassName()

This method retrieves a value of the methodName parameter.

public String getMethodName()

This method retrieves a list of values of the methodParameters parameter.

public List<MethodParameter> getMethodParameterList()



MethodParameter

Class model for method parameter.

Declared In:
com.synerise.sdk.injector.MethodParameter

Declaration:

class MethodParameter implements Validable

NOTE: In Android SDK 6.16.1, MethodParameter is package-private. You can't reference this class directly in your application code, for example when iterating over the list returned by SilentCommand.getMethodParameterList()

Properties:

Property Type Optional Default Description
className String no - Class name
value Object no - Parameter value
position int no - Parameter position

NOTE: All the properties above are accessible by using getters.

Initializers:

There are no initializers.

Methods:

This method retrieves a value of the className parameter.

public String getClassName()

This method retrieves a value of the value parameter.

public Object getValue()

This method retrieves a value of the position parameter.

public int getPosition()



InAppMessageData

Model for in-app messaging communication.

Declared In:
com.synerise.sdk.injector.inapp.InAppMessageData

Declaration:

public class InAppMessageData
class InAppMessageData

Properties:

Property Type Optional Description
campaignHash String no Identifier of the in-app message campaign.
variantId String no Identifier of the in-app message campaign variant.
additionalParameters HashMap<String, Object> yes Parameters additionally provided by the campaign.
url String yes URL value from the action of the activity.
deeplink String yes Deep link value from the action of the activity.
isTest Boolean no Specifies if the object is from a test campaign.

NOTE: All the properties above are accessible by using getters. The getter for isTest is getTest(), not isTest()

Initializers:

Constructor:

public InAppMessageData(String campaignHash, String variantId, HashMap<String, Object> additionalParameters, Boolean isTest)

Methods:

Method Return type
getCampaignHash() String
getVariantId() String
getAdditionalParameters() HashMap<String, Object>
getUrl() String
getDeepLink() String
getTest() Boolean
getType() InAppType


OnInAppListener

Listener for overlay in-app message events. Set it with Injector.setOnInAppListener(listener).

Declared In:
com.synerise.sdk.injector.inapp.OnInAppListener

Related To:
InAppMessageData
InAppCustomMethodCompletion

Declaration:

public abstract class OnInAppListener implements IInAppListener
abstract class OnInAppListener : IInAppListener

Methods:

You must implement all methods except onCustomMethod.

Method Return type Description
shouldShow(InAppMessageData) boolean Called after an in-app message is loaded, when the SDK asks for permission to show it
onShown(InAppMessageData) void Called after an in-app message appears
onDismissed(InAppMessageData) void Called after an in-app message disappears
onContextFromAppRequired(InAppMessageData) HashMap<String, Object> Called on a background thread when the SDK needs per-message context for rendering
onHandledOpenUrl(InAppMessageData) void Called when SRInApp.openUrl(url) is used in an in-app message
onHandledOpenDeepLink(InAppMessageData) void Called when SRInApp.openDeeplink(url) is used in an in-app message
onCustomAction(String, HashMap<String, Object>, InAppMessageData) void Called when SRInApp.handleCustomAction(name, params) is used in an in-app message
onCustomMethod(String, HashMap<String, Object>, InAppMessageData, InAppCustomMethodCompletion) void Called when SRInApp.customMethod(name, params) is used in an in-app message. Resolve completion exactly once. If you don't override this method, the default implementation fails the completion with onCustomMethod not implemented


InlineInAppMessageData

Model for inline in-app message data.

Declared In:
com.synerise.sdk.injector.inapp.inline.InlineInAppMessageData

Declaration:

public class InlineInAppMessageData
class InlineInAppMessageData

Properties:

Property Type Optional Description
campaignHash String no Identifier of the inline in-app message campaign
variantId String no Identifier of the inline in-app message campaign variant
placementKey String no Placement key configured in the campaign
additionalParameters Map<String, Object> yes Additional parameters provided by the campaign. Returns an unmodifiable map
isTest boolean no Specifies whether the object is from a test campaign

NOTE: All the properties above are accessible by using getters.

Methods:
There are only getters for the above properties.



InlineInAppSize

Model representing the size of an inline in-app message, reported through the onSizeChanged callback when the content calls SRInApp.setComponentSize(width, height).

Declared In:
com.synerise.sdk.injector.inapp.inline.InlineInAppSize

Declaration:

public class InlineInAppSize
class InlineInAppSize

Properties:

Property Type Optional Description
widthDp float no Width in density-independent pixels (dp)
heightDp float no Height in density-independent pixels (dp)
widthPx int no Width in physical pixels
heightPx int no Height in physical pixels
widthScreenRatio float no Width as a fraction of the device screen width (0 to 1)
heightScreenRatio float no Height as a fraction of the device screen height (0 to 1)

NOTE: All the properties above are accessible by using getters.



InlineInAppView

View that hosts an inline in-app message. Create it with Injector.createInlineInAppView(placementKey) or declare it in XML with the placementKey attribute.

Declared In:
com.synerise.sdk.injector.inapp.ui.inline.InlineInAppView

Related To:
InlineInAppMessageData
InlineInAppSize
OnInlineInAppViewListener

Inherits From:
FrameLayout

Declaration:

public class InlineInAppView extends FrameLayout
class InlineInAppView : FrameLayout

Methods:

Method Return type Description
getIdentifier() String Returns the application-defined identifier of the view
setIdentifier(String) void Sets a free-form identifier on the view
getPlacementKey() String Returns the placement key assigned to the view
setPlacementKey(String) void Sets the placement key
isRendered() boolean Returns whether an inline in-app message campaign is currently rendered
getData() InlineInAppMessageData Returns the data of the currently rendered campaign, or null
render() void Triggers on-demand rendering
release() void Destroys the WebView and unregisters the view from the SDK
setOnInlineInAppViewListener(OnInlineInAppViewListener) void Sets the per-view lifecycle listener


OnInlineInAppListener

Listener for global inline in-app message events. Set it with Injector.setOnInlineInAppListener(listener).

Declared In:
com.synerise.sdk.injector.inapp.inline.OnInlineInAppListener

Related To:
InlineInAppMessageData
InAppCustomMethodCompletion

Declaration:

public interface OnInlineInAppListener
interface OnInlineInAppListener

Methods:

Method Return type Description
onInlineInAppAvailable(InlineInAppView, InlineInAppMessageData) void Called when the SDK creates a ready-to-display view after an event-based trigger for a placement with no attached view
onContextFromAppRequired(InlineInAppMessageData) Map<String, Object> Called on a background thread when the SDK needs per-message context for rendering
onOpenedUrl(InlineInAppMessageData, String) void Called when SRInApp.openUrl(url) is used in an inline in-app message
onOpenedDeepLink(InlineInAppMessageData, String) void Called when SRInApp.openDeeplink(url) is used in an inline in-app message
onCustomAction(InlineInAppMessageData, String, Map<String, Object>) void Called when SRInApp.handleCustomAction(name, params) is used in an inline in-app message
onCustomMethod(String, HashMap<String, Object>, InlineInAppMessageData, InAppCustomMethodCompletion) void Called when SRInApp.customMethod(name, params) is used in an inline in-app message. Resolve completion exactly once


OnInlineInAppViewListener

Per-view listener for the lifecycle of an inline in-app message. Set it with InlineInAppView.setOnInlineInAppViewListener(listener).

Declared In:
com.synerise.sdk.injector.inapp.inline.OnInlineInAppViewListener

Related To:
InlineInAppMessageData
InlineInAppSize

Declaration:

public interface OnInlineInAppViewListener
interface OnInlineInAppViewListener

Methods:

Method Return type Description
onProcessingStarted() void Called when the SDK starts processing a campaign for this view
onLoaded(InlineInAppMessageData) void Called when the inline in-app message content is loaded for the first time
onUpdated(InlineInAppMessageData) void Called when the inline in-app message content is updated with a new campaign
onFailed(InlineInAppMessageData, String) void Called when the inline in-app message content fails to load or render
onSizeChanged(InlineInAppMessageData, InlineInAppSize) void Called when the content requests a size change
onRemove(InlineInAppMessageData) void Called when the content requests removal from the view hierarchy


InAppCustomMethodCompletion

Completion handler for custom methods invoked from in-app message content. Resolve it exactly once with success or failure; the first resolution wins and subsequent calls are ignored.

Declared In:
com.synerise.sdk.injector.inapp.InAppCustomMethodCompletion

Declaration:

public interface InAppCustomMethodCompletion
interface InAppCustomMethodCompletion

Methods:

Method Return type Description
success(Object) void Reports successful completion. The result must be JSON-serializable
failure(String) void Reports a failure with an error message


SyneriseMethod

Enum with a list of SDK methods that can be called from JavaScript in an in-app.

See Using in-app template builder



Removed symbols


SynerisePushResponse

iOS SDK Android SDK React Native SDK Flutter SDK
Removed in: n/a 6.0.0 n/a n/a

Class model for SynerisePushResponse.

Declared In:
com.synerise.sdk.injector.net.model.push.notification.SynerisePushResponse

Declaration:

public class SynerisePushResponse
class SynerisePushResponse

Properties:

Property Type Optional Default Description
contentAvailable Boolean no - Informs if content is available
data SynerisePush no - Synerise push data
notification SimpleNotification no - Synerise simple notification

NOTE: All the properties above are accessible by using getters.

Initializers:

There are no initializers.

Methods:

This method checks if content is available.

public boolean isContentAvailable()

This method retrieves a value for the data parameter.

public SyneriseData getData()

This method retrieves a value for the notification parameter.

public SimpleNotification getNotification()

This method checks if the push is a simple push.

public boolean isSimplePush()



TemplateBanner

iOS SDK Android SDK React Native SDK Flutter SDK
Removed in: n/a 6.0.0 n/a n/a

Class model for banners.

Declared In:
com.synerise.sdk.injector.net.model.push.banner.TemplateBanner

Declaration:

public class TemplateBanner extends BasePageMapper implements Parcelable, Validable
class TemplateBanner : BasePageMapper(), Parcelable, Validable

Properties:

Property Type Optional Default Description
campaign Campaign no - Campaign class
trigger String yes - Banner trigger
notification SimpleNotification no - Notification class
autoDisappear AutoDisappear no - Auto disappear
page NetGenericPageData yes - Page data

NOTE: All the properties above are accessible by using getters.

Initializers:

There are no initializers.

Methods:

This method retrieves the value of the campaign parameter.

public Campaign getCampaign()

This method retrieves the value of the value object.

public Object getValue()

This method checks if a banner has a trigger.

public boolean hasTrigger()

This method retrieves the trigger parameter from a banner.

public String getTrigger()

This method retrieves the value of the notification parameter.

public SimpleNotification getNotification()

This method retrieves the value of the page parameter.

public PageItem getPage()

This method retrieves the value of the autodisappear parameter.

public AutoDisappear getAutoDisappear()



AutoDisappear

iOS SDK Android SDK React Native SDK Flutter SDK
Removed in: n/a 6.0.0 n/a n/a

Class model for AutoDisappear.

Declared In:
com.synerise.sdk.injector.net.model.push.model.banner.AutoDisappear

Declaration:

public class AutoDisappear implements Serializable
class AutoDisappear : Serializable

Properties:

Property Type Optional Default Description
isEnabled Boolean no - Informs if auto disappear is enabled
timeout int no - Disappear timeout

NOTE: All the properties above are accessible by using getters.

Initializers:

There are no initializers.

Methods:

This method checks if auto disappear is enabled.

public boolean isEnabled()

This method retrieves the value of the timeout parameter.

public int getTimeout()

Canonical URL: https://hub.synerise.com/developers/mobile-sdk/class-reference/android/campaigns