whatsapp_bot_platform_interface
library
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
-
validateConnection(WpClientInterface wpClient)
→ Future
-
-
waitForInChat(WpClientInterface wpClient)
→ Future<bool>
-
-
waitForLogin(WpClientInterface wpClient, {required dynamic onQrCode(String qrCodeUrl, Uint8List? qrCodeImage)?, int waitDurationSeconds = 60, dynamic onConnectionEvent(ConnectionEvent)?, bool skipQrScan = false})
→ 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.