ichatmode_flutter_sdk 1.0.3
ichatmode_flutter_sdk: ^1.0.3 copied to clipboard
Official Flutter SDK for iChatMode ticket system. Complete support chat solution with real-time messaging, file uploads, and push notifications.
iChatMode Flutter SDK #
Lightweight SDK for embedding iChatMode ticketing + realtime updates in any Flutter app.
Features #
- Create tickets, fetch history, send messages + attachments
- WebSocket realtime updates (ticket/message/typing)
- Optional offline cache
- Local notifications + FCM hooks
- Plug-and-play config (API + company + uniqueId)
Install #
dependencies:
ichatmode_flutter_sdk: ^1.0.3
Quick start #
import 'package:ichatmode_flutter_sdk/ichatmode_flutter_sdk.dart';
await iChatMode.initialize(iChatModeConfig(
apiUrl: 'https://api.ichatmode.com/api',
apiKey: 'tk_xxx',
companyId: 'company-id',
uniqueId: 'user-unique-id',
userName: 'Demo User',
userEmail: 'demo@example.com',
debugMode: false,
));
Config #
Required:
apiUrlapiKeycompanyIduniqueId(alias:userId)
Optional:
wsUrl(defaults to apiUrl with/ws)webhookUrlenableOfflineModedebugMode
Tickets #
final tickets = await iChatMode.tickets.getTickets();
final ticket = await iChatMode.tickets.createTicket(
subject: 'Demo',
message: 'Hello',
);
final result = await iChatMode.tickets.getTicketMessages(ticket.id);
await iChatMode.tickets.replyToTicket(
ticketId: ticket.id,
message: 'Thanks',
attachmentPaths: ['/path/to/file.jpg'],
);
Realtime #
iChatMode.tickets.onMessageReceived.listen((m) {
// new message
});
iChatMode.tickets.onMessageUpdated.listen((m) {
// edited message
});
iChatMode.tickets.onMessageDeleted.listen((id) {
// deleted message
});
Notifications #
Local notifications are supported. FCM is optional; if Firebase isn’t configured, the SDK skips FCM automatically.
Webhook (optional) #
If your client has its own backend/notification system, set webhookUrl in config and handle events there.
Troubleshooting #
- If realtime updates don’t appear, verify
wsUrland token. - If attachments fail, check allowed mime types on backend.
License #
See LICENSE.