Class ForwardExtensionModule
-
- All Implemented Interfaces:
-
ai.nexconn.chatui.channel.extension.IExtensionModule
public class ForwardExtensionModule implements IExtensionModule
-
-
Constructor Summary
Constructors Constructor Description ForwardExtensionModule()
-
Method Summary
Modifier and Type Method Description voidonInit(Context context, String appKey)SDK initialization. voidonAttachedToExtension(Fragment fragment, NCExtension extension)After entering a conversation, Extension loads all registered modules. voidonDetachedFromExtension()Called when leaving a conversation; Extension releases all loaded modules. voidonReceivedMessage(Message message)After the SDK receives a message, it routes the message to the corresponding module via this method. List<IPluginModule>getPluginModules(ChannelType conversationType)Users can configure plugins in the "+" area based on different conversations. List<IEmoticonTab>getEmoticonTabs()Multiple or single emoticon tabs can be configured in a conversation. voidonDisconnect()SDK disconnected. -
-
Method Detail
-
onInit
void onInit(Context context, String appKey)
SDK initialization. Users can register custom messages, message templates, and initialize their own modules in this method.
- Parameters:
context- Context.appKey- Unique application key.
-
onAttachedToExtension
void onAttachedToExtension(Fragment fragment, NCExtension extension)
After entering a conversation, Extension loads all registered modules. Modules can hold and use the Extension. Note: if a module holds an Extension object, it must release it in the onDetachedFromExtension callback to avoid memory leaks.
- Parameters:
fragment- The fragment where the Extension object resides.extension- The Extension object.
-
onDetachedFromExtension
void onDetachedFromExtension()
Called when leaving a conversation; Extension releases all loaded modules. Note: if a module holds an Extension object, it must release it in this callback to avoid memory leaks.
-
onReceivedMessage
void onReceivedMessage(Message message)
After the SDK receives a message, it routes the message to the corresponding module via this method. Users can selectively handle received messages based on their registered message types.
- Parameters:
message- The message entity.
-
getPluginModules
List<IPluginModule> getPluginModules(ChannelType conversationType)
Users can configure plugins in the "+" area based on different conversations. One or multiple plugins can be configured; the extension displays all returned plugins. Note: if no plugins are configured, this method does not need to be implemented.
- Returns:
Plugin list.
-
getEmoticonTabs
List<IEmoticonTab> getEmoticonTabs()
Multiple or single emoticon tabs can be configured in a conversation. Once configured, this tab will be displayed in all conversations. Note: if no emoticons are configured, this method does not need to be implemented.
- Returns:
Emoticon tab list.
-
onDisconnect
void onDisconnect()
SDK disconnected.
-
-
-
-