whatsapp_bot_platform_interface library

Classes

CallEvent
Message
MessageAck
WhatsApp's delivery state of a message (msg.ack).
MessageButtons
MessageId
QrCodeImage
WhatsappBotUtils
WhatsappChatSummary
A light, serialisable view of a chat, group or channel -- enough to show it in a picker and to send to it. Pass id as the phone of any send method.
WhatsappClient
get WhatsappClient from WhatsappBotFlutter.connect() please do not try to create on your own
WhatsappEvent
Whatsapp Events, https://wppconnect.io/wa-js/modules/ev.html Add more events if needed from the above link
WhatsappLogger
WhatsAppMetadata
WpClientInterface
WppAuth
WppChat
WppConn
WppConnect
WppContact
WppEvents
WppGroup
WppLabels
WppNewsletter
WhatsApp Channels (wa-js calls them newsletters).
WppProfile
WppStatus

Extensions

JsParser on dynamic
Use JsParse extension on data we pass in Javascript string.

Functions

base64ToMap(String base64String) → Map<String, dynamic>
getMimeType(WhatsappFileType fileType, String? fileName, List<int> bytes) → String
getMimeType returns the MIME type for the given file. Tries to detect from fileName first using the mime package, then falls back to defaults based on fileType.
parseGroup(String phone) → String
parseGroup will try to convert group number in required format
parsePhone(String phone) → String
parsePhone will try to convert phone number in required format. A full chat id (...@c.us, ...@g.us, ...@newsletter, ...@lid) is passed through unchanged, so groups and channels can be sent to with the same methods.
validateConnection(WpClientInterface wpClient) → Future
waitForInChat(WpClientInterface wpClient, {String? wppVersion, String? wppJsContent, Map<String, dynamic>? wppConfig, bool autoTakeover = true}) → Future<bool>
Waits up to two minutes for the chat screen. One check at a time -- a slow check is never overlapped by the next one -- and a single page reload at 70s, after which WPP is injected again with the same version and config and the listeners are re-attached.
waitForLogin(WpClientInterface wpClient, {required dynamic onQrCode(String qrCodeUrl, Uint8List? qrCodeImage)?, int waitDurationSeconds = 60, dynamic onConnectionEvent(ConnectionEvent)?, bool skipQrScan = false, String? wppVersion, String? wppJsContent, Map<String, dynamic>? wppConfig, bool autoTakeover = true}) → Future<bool>
waitForLogin will either complete with successful login or failed with timeout exception this method will automatically try to get the qrCode also it will make sure that we get the latest qrCode Returns true if login succeeded, false if login was skipped because skipQrScan is true and the user is not authenticated.

Typedefs

OnNewEventFromListener = dynamic Function(String eventName, dynamic eventData)
Interface for creating a Whatsapp Client

Exceptions / Errors

WhatsappException