Class FeatureConfig
-
- All Implemented Interfaces:
public class FeatureConfigFeature flag configuration for the ChatUI SDK.
Obtain the singleton instance via featureConfig.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumFeatureConfig.VoiceMessageTypeVoice message quality setting.
public interfaceFeatureConfig.SSLInterceptorInterceptor for SSL certificate verification.
Register an implementation via setSSLInterceptor to customize certificate pinning or accept self-signed certificates.
-
Field Summary
Fields Modifier and Type Field Description public booleanisReferenceEnablepublic booleanisQuickReplyEnablepublic booleanisEditMessageEnablepublic booleanisUserOnlineStatusEnablepublic IQuickReplyProviderquickReplyProviderpublic FeatureConfig.VoiceMessageTypevoiceMessageTypepublic MutableLiveData<Boolean>isQuickReplypublic intaudioNBEncodingBitRatepublic intaudioWBEncodingBitRatepublic intuserCacheMaxCountpublic intgroupCacheMaxCountpublic intgroupMemberCacheMaxCountpublic booleanrc_wipe_out_notification_messagepublic booleanrc_set_java_script_enabledpublic booleansoundInForegroundpublic Stringrc_translation_src_languagepublic Stringrc_translation_target_languagepublic booleanhideEmojiButton
-
Constructor Summary
Constructors Constructor Description FeatureConfig()
-
Method Summary
Modifier and Type Method Description booleanisReferenceEnable()Returns whether the message reference (quote) feature is enabled. booleanisQuickReplyEnable()Returns whether the quick-reply feature is enabled. booleanisEditMessageEnable()Returns whether message editing on long-press is enabled. booleanisUserOnlineStatusEnable()Returns whether user online status display is enabled. IQuickReplyProvidergetQuickReplyProvider()Returns the quick-reply content provider, or nullif not set.FeatureConfig.VoiceMessageTypegetVoiceMessageType()Returns the current voice message type. voidsetVoiceMessageType(FeatureConfig.VoiceMessageType type)Sets the voice message type. MutableLiveData<Boolean>getIsQuickReply()Returns a LiveData that tracks whether quick-reply is enabled. intgetAudioNBEncodingBitRate()Returns the AMR-NB voice encoding bit rate (bps). voidsetAudioNBEncodingBitRate(int audioNBEncodingBitRate)Sets the AMR-NB voice encoding bit rate (bps). intgetAudioWBEncodingBitRate()Returns the AMR-WB voice encoding bit rate (bps). voidsetAudioWBEncodingBitRate(int audioWBEncodingBitRate)Sets the AMR-WB voice encoding bit rate (bps). intgetUserCacheMaxCount()voidsetUserCacheMaxCount(int userCacheMaxCount)intgetGroupCacheMaxCount()voidsetGroupCacheMaxCount(int groupCacheMaxCount)intgetGroupMemberCacheMaxCount()voidsetGroupMemberCacheMaxCount(int groupMemberCacheMaxCount)voidinitConfig(Context context)Initializes this configuration from Android resource values. booleanisQuickReplyType()Returns an observable for the quick-reply enabled state. voidsetChatUIImageEngine(ChatUIImageEngine engine)Sets a custom image engine. ChatUIImageEnginegetChatUIImageEngine()Returns the active image engine. booleanisReadReceiptConversationType(ChannelType type)Returns whether read receipts are enabled for the given channel type. voidenableReadReceipt(Array<ChannelType> supportedTypes)Enables read receipts for the specified channel types. voidenableReference(Boolean value)Enables or disables the message reference (quote) feature. voidenableQuickReply(IQuickReplyProvider provider)Enables the quick-reply feature. booleanisPreLoadUserCache()booleanisVibrateInForeground()Returns whether to vibrate on new messages while in the foreground. booleanisSoundInForeground()Returns whether to play a sound on new messages while in the foreground. voidsetSoundInForeground(boolean soundInForeground)Sets whether to play a sound on new messages while in the foreground. FeatureConfig.SSLInterceptorgetSSLInterceptor()Returns the SSL interceptor, or nullif not set.booleanisHideEmojiButton()Returns whether the emoji button is hidden. voidsetHideEmojiButton(boolean hideEmojiButton)Shows or hides the emoji button in the input bar. booleanisForceUseAAC()Returns whether AAC encoding is forced. voidsetForceUseAAC(boolean forceUseAAC)No-op since 5.4.1. voidsetSSLInterceptor(FeatureConfig.SSLInterceptor sSSLInterceptor)ChatUIMediaInterceptorgetChatUIMediaInterceptor()Returns the media interceptor, or nullif not set.voidsetChatUIMediaInterceptor(ChatUIMediaInterceptor kitMediaInterceptor)Sets a media interceptor for customizing Glide and WebView loading. booleanisShowUnknownMessage()Returns whether unknown message types should be displayed with a fallback view. booleanisShowUnknownMessageNotification()Returns whether an unknown message type should generate a notification. voidenableEditMessage(boolean value)Enables or disables message editing on long-press. voidenableUserOnlineStatus(boolean value)Enables or disables user online status display. voidsetPreLoadUserCache(boolean preLoadUserCache)voidsetVibrateInForeground(boolean vibrateInForeground)Sets whether to vibrate on new messages while in the foreground. voidsetShowUnknownMessage(boolean showUnknownMessage)Sets whether unknown message types should be displayed with a fallback view. voidsetShowUnknownMessageNotification(boolean showUnknownMessageNotification)Sets whether an unknown message type should generate a notification. -
-
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
nullif not set.
-
getVoiceMessageType
FeatureConfig.VoiceMessageType getVoiceMessageType()
Returns the current voice message type.
-
setVoiceMessageType
void setVoiceMessageType(FeatureConfig.VoiceMessageType type)
Sets the voice message type.
- Parameters:
type- voice quality type
-
getIsQuickReply
MutableLiveData<Boolean> getIsQuickReply()
Returns a LiveData that tracks whether quick-reply is enabled.
-
getAudioNBEncodingBitRate
int getAudioNBEncodingBitRate()
Returns the AMR-NB voice encoding bit rate (bps).
-
setAudioNBEncodingBitRate
void setAudioNBEncodingBitRate(int audioNBEncodingBitRate)
Sets the AMR-NB voice encoding bit rate (bps).
- Parameters:
audioNBEncodingBitRate- bit rate in bps
-
getAudioWBEncodingBitRate
int getAudioWBEncodingBitRate()
Returns the AMR-WB voice encoding bit rate (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
-
getGroupCacheMaxCount
int getGroupCacheMaxCount()
- Returns:
maximum number of cached group info entries
-
setGroupCacheMaxCount
void setGroupCacheMaxCount(int groupCacheMaxCount)
- Parameters:
groupCacheMaxCount- maximum group info cache size; effective only before SDK initialization
-
getGroupMemberCacheMaxCount
int getGroupMemberCacheMaxCount()
- Returns:
maximum number of cached group member info entries
-
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
-
getChatUIImageEngine
ChatUIImageEngine getChatUIImageEngine()
Returns the active image engine.
-
isReadReceiptConversationType
boolean isReadReceiptConversationType(ChannelType type)
Returns whether read receipts are enabled for the given channel type.
- Parameters:
type- channel type- Returns:
trueif 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-trueto 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
-
getSSLInterceptor
FeatureConfig.SSLInterceptor getSSLInterceptor()
Returns the SSL interceptor, or
nullif not set.
-
isHideEmojiButton
boolean isHideEmojiButton()
Returns whether the emoji button is hidden.
- Returns:
trueif the emoji button is hidden
-
setHideEmojiButton
void setHideEmojiButton(boolean hideEmojiButton)
Shows or hides the emoji button in the input bar.
- Parameters:
hideEmojiButton-trueto 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
-
setSSLInterceptor
void setSSLInterceptor(FeatureConfig.SSLInterceptor sSSLInterceptor)
- Parameters:
sSSLInterceptor- SSL certificate interceptor for CombineWebViewActivity
-
getChatUIMediaInterceptor
ChatUIMediaInterceptor getChatUIMediaInterceptor()
Returns the media interceptor, or
nullif 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.
-
isShowUnknownMessageNotification
boolean isShowUnknownMessageNotification()
Returns whether an unknown message type should generate a notification.
-
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-trueto show;falseto hide
-
setShowUnknownMessageNotification
void setShowUnknownMessageNotification(boolean showUnknownMessageNotification)
Sets whether an unknown message type should generate a notification.
- Parameters:
showUnknownMessageNotification-trueto enable
-
-
-
-