Class FeatureConfig

  • All Implemented Interfaces:

    
    public class FeatureConfig
    
                        

    Feature flag configuration for the ChatUI SDK.

    Obtain the singleton instance via featureConfig.

    • Constructor Detail

      • FeatureConfig

        FeatureConfig()
    • Method Detail

      • isReferenceEnable

         boolean isReferenceEnable()

        Returns whether the message reference (quote) feature is enabled.

      • isQuickReplyEnable

         boolean isQuickReplyEnable()

        Returns whether the quick-reply feature is enabled.

      • isEditMessageEnable

         boolean isEditMessageEnable()

        Returns whether message editing on long-press is enabled.

      • isUserOnlineStatusEnable

         boolean isUserOnlineStatusEnable()

        Returns whether user online status display is enabled.

        Since:

        5.32.0

      • getQuickReplyProvider

         IQuickReplyProvider getQuickReplyProvider()

        Returns the quick-reply content provider, or null if not set.

      • getIsQuickReply

         MutableLiveData<Boolean> getIsQuickReply()

        Returns a LiveData that tracks whether quick-reply is enabled.

      • setAudioNBEncodingBitRate

         void setAudioNBEncodingBitRate(int audioNBEncodingBitRate)

        Sets the AMR-NB voice encoding bit rate (bps).

        Parameters:
        audioNBEncodingBitRate - bit rate in bps
      • setAudioWBEncodingBitRate

         void setAudioWBEncodingBitRate(int audioWBEncodingBitRate)

        Sets the AMR-WB voice encoding bit rate (bps).

        Parameters:
        audioWBEncodingBitRate - bit rate in bps
      • getUserCacheMaxCount

         int getUserCacheMaxCount()
        Returns:

        maximum number of cached user info entries

      • setUserCacheMaxCount

         void setUserCacheMaxCount(int userCacheMaxCount)
        Parameters:
        userCacheMaxCount - maximum user info cache size; effective only before SDK initialization
      • setGroupCacheMaxCount

         void setGroupCacheMaxCount(int groupCacheMaxCount)
        Parameters:
        groupCacheMaxCount - maximum group info cache size; effective only before SDK initialization
      • setGroupMemberCacheMaxCount

         void setGroupMemberCacheMaxCount(int groupMemberCacheMaxCount)
        Parameters:
        groupMemberCacheMaxCount - maximum group member cache size; effective only before SDK initialization
      • initConfig

         void initConfig(Context context)

        Initializes this configuration from Android resource values.

        Parameters:
        context - application or activity context
      • isQuickReplyType

         boolean isQuickReplyType()

        Returns an observable for the quick-reply enabled state.

      • setChatUIImageEngine

         void setChatUIImageEngine(ChatUIImageEngine engine)

        Sets a custom image engine.

        Parameters:
        engine - the engine to use, replacing the default GlideChatUIImageEngine
      • isReadReceiptConversationType

         boolean isReadReceiptConversationType(ChannelType type)

        Returns whether read receipts are enabled for the given channel type.

        Parameters:
        type - channel type
        Returns:

        true if read receipts are enabled

      • enableReadReceipt

         void enableReadReceipt(Array<ChannelType> supportedTypes)

        Enables read receipts for the specified channel types.

        Parameters:
        supportedTypes - channel types to enable
      • enableReference

         void enableReference(Boolean value)

        Enables or disables the message reference (quote) feature.

        Parameters:
        value - true to enable
      • enableQuickReply

         void enableQuickReply(IQuickReplyProvider provider)

        Enables the quick-reply feature. Must be called before NCChatUI.initialize.

        Parameters:
        provider - content provider for quick-reply phrases
      • isPreLoadUserCache

         boolean isPreLoadUserCache()
        Returns:

        whether user cache is pre-loaded

      • isVibrateInForeground

         boolean isVibrateInForeground()

        Returns whether to vibrate on new messages while in the foreground.

        Returns:

        vibrate-on-message setting

      • isSoundInForeground

         boolean isSoundInForeground()

        Returns whether to play a sound on new messages while in the foreground.

        Returns:

        sound-on-message setting

      • setSoundInForeground

         void setSoundInForeground(boolean soundInForeground)

        Sets whether to play a sound on new messages while in the foreground.

        Parameters:
        soundInForeground - whether to play sound
      • isHideEmojiButton

         boolean isHideEmojiButton()

        Returns whether the emoji button is hidden.

        Returns:

        true if the emoji button is hidden

      • setHideEmojiButton

         void setHideEmojiButton(boolean hideEmojiButton)

        Shows or hides the emoji button in the input bar.

        Parameters:
        hideEmojiButton - true to hide
      • isForceUseAAC

        @Deprecated() boolean isForceUseAAC()

        Returns whether AAC encoding is forced. Since 5.4.1, AAC is always used instead of HE_AAC.

        Returns:

        always true

      • setForceUseAAC

        @Deprecated() void setForceUseAAC(boolean forceUseAAC)

        No-op since 5.4.1. AAC encoding is always forced.

        Parameters:
        forceUseAAC - ignored
      • getChatUIMediaInterceptor

         ChatUIMediaInterceptor getChatUIMediaInterceptor()

        Returns the media interceptor, or null if not set.

      • setChatUIMediaInterceptor

         void setChatUIMediaInterceptor(ChatUIMediaInterceptor kitMediaInterceptor)

        Sets a media interceptor for customizing Glide and WebView loading.

        Parameters:
        kitMediaInterceptor - the interceptor to use
      • isShowUnknownMessage

         boolean isShowUnknownMessage()

        Returns whether unknown message types should be displayed with a fallback view.

      • enableEditMessage

         void enableEditMessage(boolean value)

        Enables or disables message editing on long-press.

      • enableUserOnlineStatus

         void enableUserOnlineStatus(boolean value)

        Enables or disables user online status display.

        Since:

        5.32.0

      • setPreLoadUserCache

         void setPreLoadUserCache(boolean preLoadUserCache)
        Parameters:
        preLoadUserCache - whether to pre-load the user cache
      • setVibrateInForeground

         void setVibrateInForeground(boolean vibrateInForeground)

        Sets whether to vibrate on new messages while in the foreground.

        Parameters:
        vibrateInForeground - whether to vibrate
      • setShowUnknownMessage

         void setShowUnknownMessage(boolean showUnknownMessage)

        Sets whether unknown message types should be displayed with a fallback view.

        Parameters:
        showUnknownMessage - true to show; false to hide
      • setShowUnknownMessageNotification

         void setShowUnknownMessageNotification(boolean showUnknownMessageNotification)

        Sets whether an unknown message type should generate a notification.

        Parameters:
        showUnknownMessageNotification - true to enable