Methods and parameters - Android
Methods
init
Initialization method of the BlazeSDK.
Parameters:
- apiKey: The API key.
- externalUserId: The viewer ID for a logged-in viewer. Your app supplies this value. See Viewer ID specifications.
- cachingSize: The amount of possible cached content size restricted in MBs.
- cachingLevel: The level of content prefetching, which is determined by the
BlazeCachingLevelenum type. further information could be found at BlazeCachingLevel - sdkDelegate: Optional global delegates for handling SDK-wide events. further information could be found at BlazeSDKDelegate.
- playerEntryPointDelegate: Optional delegates for handling player entry point events. further information could be found at BlazePlayerEntryPointDelegate.
- completionBlock: Optional completion closure called when init is complete.
- geoLocation: Specifies a geo-location-based restriction using a geo-location code. Defaults to
null, meaning the viewer's country is determined by default using their public IP address. If set to a valid geo-location code, this value overrides the IP-based detection and becomes the effective country used for evaluating geo-targeting restrictions. further information could be found at Geo Restrictions. - forceLayoutDirection: If given - the SDK will force the layout direction for it's activities. Default is
null. - errorBlock: A closure which captures a possible initialization error of
BlazeSDK.
fun init(
apiKey: String,
externalUserId: String? = null,
cachingSize: Int? = null,
cachingLevel: BlazeCachingLevel = CachingLevel.DEFAULT,
geoLocation: String? = null,
forceLayoutDirection: BlazeLayoutDirection? = null,
sdkDelegate: BlazeSDKDelegate? = null,
playerEntryPointDelegate: BlazePlayerEntryPointDelegate? = null,
completionBlock: () -> Unit = { },
errorBlock: (failure: BlazeResult.Error) -> Unit = { }
)
OverviewThe externalUserId parameter is used to uniquely identify a user session when initializing our SDK. This identifier serves as a key for customizing and tracking user-related activities during the SDK session.
Overriding Behavior
If you re-initialize the SDK with a new externalUserId, the SDK will override the previous user identifier. The new externalUserId will be used for all subsequent activities and tracking. The previous viewer's unsynced activity is sent to WSC Sports, and their activity is cleared from the device. The previous identifier stays valid: set it again and that viewer's activity is restored.Clearing Previous User Identifier
If you initialize the SDK with externalUserId set to null, it will clear the previous user identifier, effectively anonymizing the session. Activities in this state will not be associated with any user identifier until a new externalUserId is set.Recommended Practice
Due to our overriding and clearing behavior, it is crucial to use careful logic in your application to manage when and how to initialize new sessions. Make sure that you are intentionally setting or clearing externalUserId based on the desired outcome for user tracking and activity management.
Global Static Methods
Viewer ID
setExternalUserId
Sets the viewer ID for the current viewer. See Viewer ID specifications.
- To log a viewer in, pass their viewer ID.
- To log a viewer out, pass
null. The viewer becomes anonymous.
Always pass null to log a viewer out, never a blank string. On Android, a blank or whitespace-only string currently behaves the same as null, but this isn't guaranteed and doesn't hold on every platform. On iOS a blank string is stored as the viewer ID itself, which pools every viewer who sends one into a single viewer. Don't rely on the blank-string behavior in your integration.
fun setExternalUserId(
externalUserId: String?,
completionBlock: BlazeResult<Unit>) -> Unit = { }
)Content localization
setPreferredLanguage
Parameters:
- preferredLanguage: Preferred language code (e.g., "en", "es", "es-MX"). This given parameter is being trimmed before being set.
Note:
- Empty strings are considered as null and will reset the preferred language.
fun setPreferredLanguage(preferredLanguage: String?)Stories
playStory
Plays a page within a story with the specified story ID and page ID. If pageId is null, playing page according to read/unread logic.
Parameters:
- storyId: The ID of the story to be played.
- pageId: The ID of the page in the story to start from. Defaults to
null. - storyPlayerStyle: An instance of
[BlazeStoryPlayerStyle]which determines the style of a story component, default will take the global style. - triggerSource: The source from which the content is triggered. default is
ENTRYPOINT. - sourceId: An optional entry point identifier for tracking delegate context. This value will be available in the sourceId field of delegate methods.
- completionBlock: Optional completion closure called when the story will start playing. It provides a
BlazeResultobject , with aSuccesson success or anErroron failure.
playStories
Plays stories for a specific dataSource type. This method plays the stories for the provided dataSource, which is built using BlazeDataSourceType.
Parameters:
- dataSource:
BlazeDataSourceTypeto filter the stories. - storyPlayerStyle: An instance of
[BlazeStoryPlayerStyle]which determines the theme of a story component, default will take the global style. - triggerSource: The source from which the content is triggered. default is
ENTRYPOINT. - shouldOrderContentByReadStatus: If true, the content will be ordered by read status. Defaults to
true. - sourceId: An optional entry point identifier for tracking delegate context. This value will be available in the sourceId field of delegate methods.
- entryContentId: Optional content ID to be displayed first in the player. This can be an additional content item that may not be part of the content defined by the dataSourceType.
Note: This parameter is also used as part of the cache key for prepared content. Preparing content with null and then playing with a specific entryContentId will result in a new fetch instead of using prepared elements. - completionBlock: Optional completion closure called when the stories are played. It provides a
BlazeResultobject , with aSuccesson success or anErroron failure.
fun playStories(
dataSource: BlazeDataSourceType,
storyPlayerStyle: BlazeStoryPlayerStyle = defaultStoryPlayerStyle,
triggerSource: BlazeEntryPointTriggerSource = BlazeEntryPointTriggerSource.ENTRYPOINT,
shouldOrderContentByReadStatus: Boolean = true,
sourceId: String? = null,
entryContentId: String? = null
completionBlock: (BlazeResult<Unit>) -> Unit = { }
)prepareStories
Prepares and loads stories for a specific dataSource type. This method prepares and loads stories for the provided dataSource expression, which is built using BlazeDataSourceType.
Parameters:
- dataSource:
BlazeDataSourceTypeto filter the stories. - sourceId: An optional entry point identifier for tracking delegate context. This value will be available in the sourceId field of delegate methods.
- entryContentId: Optional content ID to be displayed first in the player. This can be an additional content item that may not be part of the content defined by the dataSourceType.
Note: This parameter is also used as part of the cache key for prepared content. Preparing content with null and then playing with a specific entryContentId will result in a new fetch instead of using prepared elements. - completionBlock: Optional completion closure called when the stories are prepared and loaded. I It provides a
BlazeResultobject , with aSuccesson success or anErroron failure.
fun prepareStories(
dataSource: BlazeDataSourceType,
sourceId: String? = null,
entryContentId: String? = null,
completionBlock: (BlazeResult<Unit>) -> Unit = { }
)setDefaultStoryPlayerStyle
Global method to set the story's player style.
Parameters:
storyPlayerStyle: An instance ofBlazeStoryPlayerStylewhich determines the overall style of a story player component.
This method will update defaultStoryPlayerStyle, which will be used wherever it is not overridden.
fun setDefaultStoryPlayerStyle(storyPlayerStyle: BlazeStoryPlayerStyle)getDefaultStoryPlayerStyle
Get the default style for Stories.
Note: This returns a deep-cloned instance of the raw style to ensure no modifications by reference.
Parameters:
An instance of BlazeStoryPlayerStyle which determines the overall style of a story player component.
fun getDefaultStoryPlayerStyle(): BlazeStoryPlayerStyleMoments
playMoment
Plays a moment with the specified moment ID.
Parameters:
- momentId: The ID of the moment to be played.
- momentsPlayerStyle: An instance of
[BlazeMomentsPlayerStyle]which determines the style of a moment component, default will take the global style. - triggerSource: The source from which the content is triggered. default is
ENTRYPOINT. - sourceId: An optional entry point identifier for tracking delegate context. This value will be available in the sourceId field of delegate methods.
- playbackConfiguration: An instance of
[BlazeMomentsPlaybackConfiguration]which determines the playback behavior of moments. Default will take the global playback configuration. - completionBlock: Optional completion closure called when the moment will start playing. It provides a
BlazeResultobject , with aSuccesson success or anErroron failure.
fun playMoment(
momentId: String,
momentsPlayerStyle: BlazeMomentsPlayerStyle = defaultMomentsPlayerStyle,
triggerSource: BlazeEntryPointTriggerSource = BlazeEntryPointTriggerSource.ENTRYPOINT,
sourceId: String? = null,
playbackConfiguration: BlazeMomentsPlaybackConfiguration = defaultMomentsPlaybackConfiguration
completionBlock: (BlazeResult<Unit>) -> Unit = {}
)playMoments
Plays moments for a specific dataSource type. This method plays the moments for the provided dataSource, which is built using BlazeDataSourceType.
Parameters:
- dataSource:
BlazeDataSourceTypeto filter the moments. - momentsPlayerStyle: An instance of
[BlazeMomentsPlayerStyle]which determines the style of a moment component, default will take the global style. - triggerSource: The source from which the content is triggered. default is
ENTRYPOINT. - playbackConfiguration: An instance of
[BlazeMomentsPlaybackConfiguration]which determines the playback behavior of moments. Default will take the global playback configuration. - shouldOrderContentByReadStatus: If true, the content will be ordered by read status. Defaults to
true. - sourceId: An optional entry point identifier for tracking delegate context. This value will be available in the sourceId field of delegate methods.
- entryContentId: Optional content ID to be displayed first in the player. This can be an additional content item that may not be part of the content defined by the dataSourceType.
Note: This parameter is also used as part of the cache key for prepared content. Preparing content with null and then playing with a specific entryContentId will result in a new fetch instead of using prepared elements. - completionBlock: Optional completion closure called when the moments are played. It provides a
BlazeResultobject , with aSuccesson success or anErroron failure.
fun playMoments(
dataSource: BlazeDataSourceType,
momentsPlayerStyle: BlazeMomentsPlayerStyle = defaultMomentsPlayerStyle,
triggerSource: BlazeEntryPointTriggerSource = BlazeEntryPointTriggerSource.ENTRYPOINT,
shouldOrderContentByReadStatus: Boolean = true,
sourceId: String? = null,
entryContentId: String? = null,
playbackConfiguration: BlazeMomentsPlaybackConfiguration = defaultMomentsPlaybackConfiguration,
completionBlock: (BlazeResult<Unit>) -> Unit = { }
)prepareMoments
Prepares and loads moments for a specific dataSource type. This method prepares and loads moments for the provided dataSource expression, which is built using BlazeDataSourceType.
Parameters:
- dataSource:
BlazeDataSourceTypeto filter the moments. - sourceId: An optional entry point identifier for tracking delegate context. This value will be available in the sourceId field of delegate methods.
- entryContentId: Optional content ID to be displayed first in the player. This can be an additional content item that may not be part of the content defined by the dataSourceType.
Note: This parameter is also used as part of the cache key for prepared content. Preparing content with null and then playing with a specific entryContentId will result in a new fetch instead of using prepared elements. - completionBlock: Optional completion closure called when the moments are prepared and loaded. It provides a
BlazeResultobject , with aSuccesson success or anErroron failure.
fun prepareMoments(
dataSource: BlazeDataSourceType,
sourceId: String? = null,
entryContentId: String? = null,
completionBlock: (BlazeResult<Unit>) -> Unit = {}
)setDefaultMomentsPlayerStyle
Global method to set the moments theme.
Parameters:
- momentsPlayerStyle: An instance of
BlazeMomentsPlayerStylewhich determines the overall style of a moments player component.
This method will update defaultMomentsPlayerStyle, which will be used wherever it is not overridden.
fun setDefaultMomentsPlayerStyle(momentsPlayerStyle: BlazeMomentsPlayerStyle)getDefaultMomentsPlayerStyle
Get the default style for moments.
Note: This returns a deep-cloned instance of the raw style to ensure no modifications by reference.
Parameters:
An instance of BlazeMomentsPlayerStyle which determines the overall style of a moments player component.
fun getDefaultMomentsPlayerStyle(): BlazeMomentsPlayerStyleappendMomentsToPlayer
Appends moments to the currently playing player.
Parameters:
-
sourceId The source identifier for the player.
-
dataSourceType The data source built with
BlazeDataSourceTypeto fetch the moments. -
shouldOrderContentByReadStatus If true, the content will be ordered by read status. Defaults to
false. -
completion Optional completion called when the moments are appended.
It provides a
BlazeResultsuccess value on success or anErroron failure.
fun appendMomentsToPlayer(
sourceId: String,
dataSourceType: BlazeDataSourceType,
shouldOrderContentByReadStatus: Boolean = false,
completion: (BlazeResult<Unit>) -> Unit = {}
)setDefaultMomentsPlaybackConfiguration
Set a default playback configuration for Moments.
Parameters:
- playbackConfiguration: An instance of
BlazeMomentsPlaybackConfigurationwhich determines the overall playback configuraions of a Moments player component.
This method will update defaultMomentsPlaybackConfiguration, which will be used wherever it is not overridden.
fun setDefaultMomentsPlaybackConfiguration(playbackConfiguration: BlazeMomentsPlaybackConfiguration)getDefaultMomentsPlaybackConfiguration
Get the default playback configuration for Moments.
Note: This returns a deep-cloned instance of the playback configurations to ensure no modifications by reference.
fun getDefaultMomentsPlaybackConfiguration(): BlazeMomentsPlaybackConfigurationVideos
playVideo
Plays a video with the specified video ID.
Parameters:
- videoId: The ID of the video to be played.
- videosPlayerStyle: An instance of
[BlazeVideosPlayerStyle]which determines the style of a video component, default will take the global style. - triggerSource: The source from which the content is triggered. default is
ENTRYPOINT. - sourceId: An optional entry point identifier for tracking delegate context. This value will be available in the sourceId field of delegate methods.
- playbackConfiguration: Optional playback configurations.
- completionBlock: Optional completion closure called when the video will start playing. It provides a
BlazeResultobject , with aSuccesson success or anErroron failure.
fun playVideo(
videoId: String,
videosPlayerStyle: BlazeVideosPlayerStyle = defaultVideosPlayerStyle,
triggerSource: BlazeEntryPointTriggerSource = BlazeEntryPointTriggerSource.ENTRYPOINT,
sourceId: String? = null,
playbackConfiguration: BlazeVideosPlaybackConfiguration,
completionBlock: (BlazeResult<Unit>) -> Unit = {}
)playVideos
Plays videos for a specific dataSource type. This method plays the videos for the provided dataSource, which is built using BlazeDataSourceType.
Parameters:
- dataSource:
BlazeDataSourceTypeto filter the videos. - videosPlayerStyle: An instance of
[BlazeVideosPlayerStyle]which determines the style of a video component, default will take the global style. - triggerSource: The source from which the content is triggered. default is
ENTRYPOINT. - shouldOrderContentByReadStatus: If true, the content will be ordered by read status. Defaults to
true. - sourceId: An optional entry point identifier for tracking delegate context. This value will be available in the sourceId field of delegate methods.
- entryContentId: Optional content ID to be displayed first in the player. This can be an additional content item that may not be part of the content defined by the dataSourceType.
Note: This parameter is also used as part of the cache key for prepared content. Preparing content with null and then playing with a specific entryContentId will result in a new fetch instead of using prepared elements. - playbackConfiguration: Optional playback configurations.
- completionBlock: Optional completion closure called when the videos are played. It provides a
BlazeResultobject , with aSuccesson success or anErroron failure.
fun playVideos(
dataSource: BlazeDataSourceType,
videosPlayerStyle: BlazeVideosPlayerStyle = defaultVideosPlayerStyle,
triggerSource: BlazeEntryPointTriggerSource = BlazeEntryPointTriggerSource.ENTRYPOINT,
shouldOrderContentByReadStatus: Boolean = true,
sourceId: String? = null,
entryContentId: String? = null,
playbackConfiguration: BlazeVideosPlaybackConfiguration,
completionBlock: (BlazeResult<Unit>) -> Unit = { }
)prepareVideos
Prepares and loads videos for a specific dataSource type. This method prepares and loads videos for the provided dataSource expression, which is built using BlazeDataSourceType.
Parameters:
- dataSource:
BlazeDataSourceTypeto filter the videos. - sourceId: An optional entry point identifier for tracking delegate context. This value will be available in the sourceId field of delegate methods.
- entryContentId: Optional content ID to be displayed first in the player. This can be an additional content item that may not be part of the content defined by the dataSourceType.
Note: This parameter is also used as part of the cache key for prepared content. Preparing content with null and then playing with a specific entryContentId will result in a new fetch instead of using prepared elements. - completionBlock: Optional completion closure called when the videos are prepared and loaded. It provides a
BlazeResultobject , with aSuccesson success or anErroron failure.
fun prepareVideos(
dataSource: BlazeDataSourceType,
sourceId: String? = null,
entryContentId: String? = null,
completionBlock: (BlazeResult<Unit>) -> Unit = {}
)setDefaultVideosPlayerStyle
Global method to set the videos theme.
Parameters:
- videosPlayerStyle: An instance of
BlazeVideosPlayerStylewhich determines the overall style of a videos player component.
This method will update defaultVideosPlayerStyle, which will be used wherever it is not overridden.
fun setDefaultVideosPlayerStyle(videosPlayerStyle: BlazeVideosPlayerStyle)getDefaultVideosPlayerStyle
Get the default style for videos.
Note: This returns a deep-cloned instance of the raw style to ensure no modifications by reference.
Parameters:
An instance of BlazeVideosPlayerStyle which determines the overall style of a videos player component.
fun getDefaultVideosPlayerStyle(): BlazeVideosPlayerStylesetDefaultVideosPlaybackConfiguration
Set a default playback configuration for videos.
Parameters:
- playbackConfiguration: An instance of
BlazeVideosPlaybackConfigurationwhich determines the overall playback configuraions of a videos player component.
This method will update defaultPlaybackConfiguration, which will be used wherever it is not overridden.
fun setDefaultVideosPlaybackConfiguration(playbackConfiguration: BlazeVideosPlaybackConfiguration)getDefaultVideosPlaybackConfiguration
Get the default playback configuration for videos.
Note: This returns a deep-cloned instance of the playback configurations to ensure no modifications by reference.
fun getDefaultVideosPlaybackConfiguration(): BlazeVideosPlaybackConfigurationPlayers
dismissCurrentPlayer
Dismisses the current playing player if exists.
fun dismissCurrentPlayer()pauseCurrentPlayer
Pauses the currently playing player if it is active. This method does not dismiss the player; it simply pauses playback, allowing for later resumption.
fun pauseCurrentPlayer()resumeCurrentPlayer
Resumes playback of the currently paused player, if any. If the player is not currently paused, this method has no effect.
fun resumeCurrentPlayer()setPlayerSoundState
Sets the sound state for playback of Stories, Moments, and Videos.
Parameters:
- state: Pass
BlazePlayerSoundState.MUTEto mute playback, orBlazePlayerSoundState.UNMUTEto unmute.
Note: This value is not persisted by the SDK. The hosting app is responsible for re-applying it on each launch.
fun setPlayerSoundState(state: BlazePlayerSoundState)Example:
BlazeSDK.setPlayerSoundState(BlazePlayerSoundState.MUTE)
BlazeSDK.setPlayerSoundState(BlazePlayerSoundState.UNMUTE)Screens
Provides access to full-screen SDK experiences such as the search screen. Access via BlazeSDK.screens.
val screens: BlazeScreensSee BlazeScreens for full details.
showSearchScreen
Launches the Blaze search screen, providing a full-screen search experience with suggestions and search results across all content types.
Parameters:
- searchParams: Configuration parameters for the search screen (
BlazeSearchScreenParams). See BlazeSearchScreenParams for details. - completionBlock: Optional completion called when the search screen is launched. It provides a
BlazeResultsuccess value on success or anErroron failure.
fun showSearchScreen(
searchParams: BlazeSearchScreenParams,
completionBlock: (BlazeResult<Unit>) -> Unit = {}
)Universal Links
handleUniversalLink
Handles a universal link URL. This method takes a universal link URL as a string, processes it and optionally returns a result via a completion handler.
Parameters:
- link: A string representing the universal link URL to be handled.
- sourceId: An optional entry point identifier for tracking delegate context. This value will be available in the sourceId field of delegate methods.
- completionBlock: An optional completion block that's called when the universal link is finished processing. It provides a
Resultsuccess value on success or anErroron failure.
The link parameter should be a string representing a valid universal link URL. If the string isn't a valid URL, the method will return an error via the completion handler.
The completionBlock is optional. If you don't provide one, the method will process the universal link but won't provide a success or failure result.
fun handleUniversalLink(
link: String,
sourceId: String? = null,
completionBlock: (BlazeResult<Unit>) -> Unit = { }
)canHandleUniversalLink
Determines if a given URL is recognized as a universal link for the Blaze SDK. The function checks if the provided link contains the domain specified as a universal link within the Blaze SDK's configuration.
Parameters:
- link: The URL to be checked against the universal link domain.
Returns:
trueif the URL contains the domain considered as a universal link for the SDK,falseotherwise.
fun canHandleUniversalLink(link: String): BooleanGeolocation Restrictions
updateGeoRestriction
Updates or removes the geo-restriction based on the provided geo location code. This value overrides the default IP-based country detection and becomes the effective country used for evaluation.
This method validates the given geo-location code and updates the geo-restriction settings accordingly. A null value for the geo-location code indicates that the system should remove any existing overrides and revert to IP-based detection. The operation is executed asynchronously, and the outcome is communicated back through the completionBlock.
Parameters:
geoLocation: The geolocation code should conform to the ISO 3166-1 alpha-2 standard. Whennull, it signals the removal of any existing geo-restrictions.completionBlock: An optional completion block that is invoked with the result of the operation, Providing aBlazeResultthat can either be a success indicating the update was successful or an error with details about the failure.
fun updateGeoRestriction(
geoLocation: String?,
completionBlock: (BlazeResult<Unit>) -> Unit = { }
)Ads
googleCustomNativeAdsHandler
In order to integrate the Google Custom Native Ads into your app, we recommend using our GAM module.
In case our module isn't sufficient for your requirements, you may consult with us how to solve it.
If there is no other solution, you may follow Custom GAM implementation for implementing it on your own.
fun setGoogleCustomNativeAdsHandler(
googleCustomNativeAdsHandler: BlazeGoogleCustomNativeAdsHandler?
)googleBannerAdsHandler
In order to integrate the Google banner ads into your app, we recommend using our GAM module.
In case our module isn't sufficient for your requirements, you may consult with us how to solve it.
If there is no other solution, you may follow Custom GAM implementation for implementing it on your own.
fun setGoogleBannerAdsHandler(
googleBannerAdHandler: BlazeGAMBannerAdsHandler?
)imaHandler
In order to integrate the IMA ads into your app, we recommend using our IMA module.
In case our module isn't sufficient for your requirements, you may consult with us how to solve it.
If there is no other solution, you may follow Custom IMA implementation for implementing it on your own.
fun setImaHandler(
imaHandler: BlazeImaHandler?
)Picture in Picture
val pipManager: BlazePiPManagerProvides access to the PIP manager for observing state and controlling PIP sessions. See BlazePiPManager for full details.
Push Notifications
handleNotificationValue
Handles a notification value.
This method takes a json as a string, processes it and optionally returns a result via a completion handler.
fun handleNotificationValue(
blazeNotificationBody: String,
sourceId: String? = null,
completionBlock: (BlazeResult<Unit>) -> Unit = { }
)Parameters:
blazeNotificationBody- A string representing the value of the notification to be handled.- sourceId: An optional entry point identifier for tracking delegate context. This value will be available in the sourceId field of delegate methods.
completionBlock- An optional completion handler that's called when the value of the notification finished processing. The completion handler takes a parameter that indicates whether the processing was successful, or contains an error if there was a failure. ThecompletionBlockhandler is a closure that takes a parameter of typeBlazeResult. This parameter represents the result of processing the value of the notification:- If the processing was successful, the result should be
BlazeResult.SUCCESS. - If there was an error, the result should be
BlazeResult.ERRORwith an associated error object.
- If the processing was successful, the result should be
The completionBlock handler is optional. If you don't provide one, the method will process the notification's payload but won't provide a success or failure result.
handlePushNotificationPayload
Handles a notification's payload.
This method takes a map representing the payload of a notification, processes it, and optionally returns a result via a completion handler.
fun handlePushNotificationPayload(
payload: Map<String, String>,
sourceId: String? = null,
completionBlock: (BlazeResult<Unit>) -> Unit = { }
)Parameters:
payload- A map representing the payload to be handled. The keys and values are specific to the notification's data structure.- sourceId: An optional entry point identifier for tracking delegate context. This value will be available in the sourceId field of delegate methods.
completionBlock- An optional completion handler that's called when the payload is finished processing. The completion handler takes a parameter that indicates whether the processing was successful, or contains an error if there was a failure. ThecompletionBlockhandler is a closure that takes a parameter of typeBlazeResult. This parameter represents the result of processing the payload:- If the processing was successful, the result should be
BlazeResult.SUCCESS. - If there was an error, the result should be
BlazeResult.ERRORwith an associated error object.
- If the processing was successful, the result should be
The completionBlock handler is optional. If you don't provide one, the method will process the notification's payload but won't provide a success or failure result.
canHandlePushNotification
This method takes a notification's payload, processes it and indicates if it can be handled by the SDK.
The function checks if the provided payload contains the key specified as BlazeSDK key.
fun canHandlePushNotification(
payload: Map<String, String>
): BooleanParameters:
payload- A map representing the payload to be handled. The keys and values are specific to the notification's data structure.- Returns:
trueif the SDK can handle the notification's payload, otherwise returnsfalse.
Note: This method can be used to determine whether the SDK can handle a given payload, returning the result synchronously, before calling handlePushNotificationPayload(payload: Map<String, String>, (BlazeResult<Unit>) -> Unit).
Do Not Track
setDoNotTrack
This method determines whether a user should be marked as an anonymous user or not.
fun setDoNotTrack(doNotTrackUser: Boolean)Parameters:
doNotTrackUser- Iftrue, the user will be marked as anonymous for analytics purposes.
disableAnalytics
disableAnalytics
A public Boolean value that determines whether the SDK collects and sends analytics data to WSC. false By default, this means analytics are being collected by default.
var disableAnalytics: Boolean = falseisMuted
Current SDK-wide mute state for playback of Stories, Moments, and Videos.
Returns true by default if setPlayerSoundState has not been called.
val isMuted: BooleanUser Activity
disableUserActivity
A public Boolean value that determines whether the SDK syncs user activity data.
When true, all user activity periodic sync tasks are stopped and sync operations are skipped.
When toggled back to false, the periodic tasks are restarted immediately.
false by default, meaning user activity is synced normally.
NoteUser activity sync is automatically skipped for anonymous users (when no
externalUserIdis set), regardless of this property.
var disableUserActivity: Boolean = falseclearLocalUserActivity
Clears all locally stored user activity data.
Does not affect remote data and does not make any API calls.
Data cleared includes: viewed story pages, viewed moments, viewed videos, liked moments, liked videos, and interactions.
fun clearLocalUserActivity()Updated 16 days ago
