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.

  • setMaxRecordDurationallows you to set different video record durations. You may use it as shown below:
val config = MomentsConfig.Builder()
    .setCameraConfig(MomentsCameraConfig.Builder()
        .setMaxRecordDuration(MaxRecordDuration.FULL)
        .build())
    .build(MOMENTS_TOKEN, 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 setLinkCTAConfigand 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.
val linkCTAConfig = MomentsLinkCTAConfig.Builder()
    .setMomentsLinkCTAState(LinkCTAState.All)
    .setMomentsLinkItems(listOf(
      MomentsLinkItem(name = "In-app Link_1", link = "In-app URL_1"),
      MomentsLinkItem(name = "In-app Link_2", link = "In-app URL_2")
    ))
    .setLinkTextColor(color = Color.parseColor("Your_Color") )
    .build()
        
val textConfig = MomentsTextConfig.Builder()
    .setCustomFonts(listOf(
      CustomFont("Your Custom Font", Typeface.createFromAsset(assets, "YourCustomFont.otf")),
      CustomFont("moments_system", Typeface.DEFAULT)
    ))
    .build()
    
val interactiveConfig = MomentsInteractiveConfig.Builder()
    .setLinkCTAConfig(linkCTAConfig)
    .setTextConfig(textConfig)
    .build()

📘

States of Link CTA

If you set LinkCTAState as InApp, 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:

val config = MomentsConfig.Builder()
    .setInteractiveConfig(interactiveConfig)
    .build(MOMENTS_TOKEN, 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.
 val config = MomentsConfig.Builder()
     .setMomentsTheme(MomentsThemeConfig.Builder()
         .setFont(Typeface.MONOSPACE)
         .setAnalyticsViewType(isCustom = true)
         .setIconStyling(momentsIconStylingConfig = MomentsIconStylingConfig.Builder().build())
         .build())
     .build(MOMENTS_TOKEN, USER_PAYLOAD)