FAQ
Integration
Initialization succeeds, but UI pages do not load data
Make sure EngineProvider.initialize is called before connecting or opening data-driven pages. Pages such as ChannelPage, ChatPage, GroupPage, and NexconnUserProfilePage rely on the Nexconn SDK being initialized.
final engineProvider = context.read<EngineProvider>();
await engineProvider.initialize(
InitParams(appKey: appKey),
);
await engineProvider.connect(
ConnectParams(token: token),
);
Also confirm that NexconnChatUIProviders or equivalent provider wiring is above the pages that call context.read<EngineProvider>().
Connection fails
Check the network, token validity, app key, and data center configuration. EngineProvider.connect returns the native result code and also passes an NCError? to the callback.
final code = await engineProvider.connect(
ConnectParams(token: token),
handler: (userId, error) {
if (error != null && !error.isSuccess) {
debugPrint(error.message ?? error.reason ?? 'Connect failed');
}
},
);
if (code != 0) {
debugPrint('Connect returned code $code');
}
Messages
New messages are not visible
Confirm that the connection is active and that the page owns a ChatProvider for the same BaseChannel. ChatPage creates one automatically.
For global side effects, listen through EngineProvider.
final engineProvider = context.read<EngineProvider>();
void onMessage() {
final message = engineProvider.receivedMessageNotifier.value;
if (message != null) {
debugPrint('Received message ${message.messageId}');
}
}
engineProvider.receivedMessageNotifier.addListener(onMessage);
Remove listeners in dispose.
Sending a text message fails
Check the connection status, the target channel, and the error passed through send hooks or provider state.
ChatPage(
channel: DirectChannel('target_user_id'),
config: ChatPageConfig(
onAfterSendMessage: (channel, params, message, error) {
if (error != null && !error.isSuccess) {
debugPrint(error.message ?? error.reason ?? 'Send failed');
}
},
),
);
When using a custom provider directly:
final chatProvider = ChatProvider(
channel: DirectChannel('target_user_id'),
engineProvider: context.read<EngineProvider>(),
);
await chatProvider.loadInitialMessages();
await chatProvider.sendText('Hello');
History messages do not appear
Call loadInitialMessages before reading ChatProvider.messages, or use ChatPage, which performs the initial load.
await chatProvider.loadInitialMessages();
if (chatProvider.lastError != null) {
debugPrint(chatProvider.lastError!.message ?? chatProvider.lastError!.reason);
}
If the list is still empty, confirm that the channel ID and ChannelType match the messages stored for that user.
Users and groups
Avatars or names are missing
Configure ChannelConfig.profileProvider when the same resolver should drive the channel list and the default chat page. Configure ChatPageConfig.profileProvider for a standalone chat page, or ChannelItemConfig.displayProfileResolver when channel rows need a different display value. For full user pages, configure NexconnUserProfileProviderConfig or rely on the default Nexconn SDK profile APIs.
ChannelConfig(
profileProvider: (channel, {message}) async {
final userId = message?.senderUserId ?? channel.channelId;
final profile = await accountRepository.loadUser(userId);
return ChatProfileInfo(
id: userId,
name: profile?.displayName ?? userId,
portraitUri: profile?.avatarUrl,
);
},
);
Group pages show unsupported actions
Check the GroupProvider capability flags before showing editing, leave, or dismiss actions.
if (groupProvider.supportsUpdateGroupProfile) {
// Show profile editing controls.
}
if (groupProvider.supportsLeaveGroup) {
// Show leave action.
}
When your app needs custom group behavior, inject a GroupOperations implementation.
Notifications
Local notifications are not shown
Local notifications are best-effort and depend on platform permission, app process state, and your app configuration. Enable them through EngineProvider.setupLocalNotification(enable: true) and verify platform permissions.
await context.read<EngineProvider>().setupLocalNotification(enable: true);
Use remote push for terminated-app and offline alerts.
Muted channels still receive messages
That is expected. Channel Do Not Disturb changes alert behavior. It does not block message receipt, storage, unread count, or sync.
final muted = channel.notificationLevel == ChannelNoDisturbLevel.blocked;
Use ChannelProvider.muteChannel and ChannelProvider.unmuteChannel to update the state.
Performance
Message screens use too much memory
Use paged loading, avoid eager media decoding, remove listeners in dispose, and prefer the built-in list widgets or ListView.builder for custom message lists. Keep profile lookup caches bounded if your app resolves many unique senders in large group channels.