Configuration
Although initialization of Config
requires two mandatory string parameters (Moments Token & User Payload), there are additional configurations that you can do as well, which are shown below:
Camera Configurations
There is one camera configuration that can be changed, which is setMaxRecordDuration
.
setMaxRecordDuration
allows you to set different video record durations. You may use it as shown below:
let config = MomentsConfig.Builder()
.setInteractiveConfig(config: interactiveConfigs)
.setCameraConfig(config: MomentsCameraConfig.Builder()
.setMaxRecordDuration(duration: MaxRecordDuration.full)
.build())
.build(momentsToken:MOMENTS_TOKEN, userPayload: USER_PAYLOAD)
Record Durations
QUARTER
enables your users to record videos up to 15 seconds for a Single Moments Story.
HALF
enables your users to record videos up to 30 seconds for a Single Moments Story.
FULL
enables your users to record videos up to 60 seconds for a Single Moments Story.
Warning
Camera configuration does not change the maximum Moments Story record duration, which is 120 seconds.
Interactive Configurations
There are two interactive configurations that can be changed, which are setLinkCTAConfig
and setTextConfig
.
setLinkCTAConfig
allows you to set different states for the link CTA usage in Moments Story.setTextConfig
allows you to set different fonts for texts that can be added to Moments Story.
let linkCTAConfig = MomentsLinkCTAConfig.Builder()
.setMomentsLinkCTAState(LinkCTAState.All)
.setMomentsLinkItems(items: [MomentsLinkItem(name: "In-app Link_1", link = "In-app URL_1"),
MomentsLinkItem(name: "In-app Link_2", link = "In-app URL_2")])
.setLinkTextColor(color: UIColor)
.build()
let momentsTextConfig = MomentsTextConfig.Builder()
.setCustomFonts(fonts: "Your_Custom_Fonts")
.build()
let interactiveConfigs = MomentsInteractiveConfig.Builder()
.setTextConfig(config: momentsTextConfig)
.setLinkCTAConfig(config: linkCTAConfig)
.build()
States of Link CTA
If you set
LinkCTAState
asInApp
, only in-app linking is enabled.If you set
LinkCTAState
asOutlink
, only out-linking is enabled.If you set
LinkCTAState
asAll
, all linking options are enabled.If you set
LinkCTAState
asDisabled
, all linking options are disabled.
After configuring MomentsInteractiveConfig
you may use it as shown below:
let config = MomentsConfig.Builder()
.setInteractiveConfig(config: interactiveConfigs)
.build(momentsToken:MOMENTS_TOKEN, userPayload: USER_PAYLOAD)
Warning
If you'd like to set a custom font, please make sure that you're using the same font for the Storlyly SDK as you can see here.
Theme Configurations
There are three theme configurations that can be changed, which are setAnalyticsViewType
, setFont
and setIconStyling
.
setAnalyticsViewType
allows you to use your own custom analytics view for Likes and Views.setFont
allows you to set a custom font in all Moments-related screens.setIconStyling
allows you to set custom icons for Moments Stories.
let config = MomentsConfig.Builder()
.setMomentsTheme(theme: MomentsThemeConfig.Builder()
.setFont(font: UIFont.italicSystemFont(ofSize: 16))
.setAnalyticsViewType(isCustom: true)
.setIconStyling(iconStyling: MomentsIconStylingConfig.Builder().build())
.build())
.build(momentsToken:MOMENTS_TOKEN, userPayload: USER_PAYLOAD)
Updated 5 months ago