搜尋套件、儲存庫與 APP 分類

套件詳情v0.2.0

whatsapp_sender_flutter

WhatsApp Sender Flutter 是一個用於 Flutter 的非官方 API,可用來批量發送 WhatsApp 訊息

macOSWindowsLinux
近 30 天下載
45
喜歡數
31
Pub 分數
125

安裝套件

flutter pub add whatsapp_sender_flutter

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

WhatsApp Sender Flutter 是一個非官方的 Flutter 套件,讓開發者能以程式化方式發送大量 WhatsApp 訊息。它透過瀏覽器自動化方式與 WhatsApp Web API 整合,可在無需官方 WhatsApp API 存取的情況下實現訊息傳遞。此套件專為 macOS、Windows 及 Linux 等桌面平台設計,適用於自動化通知、提醒或行銷活動。該套件需手動設定,並依賴活躍的 WhatsApp Web 會話。雖然功能正常,但其運作方式違反官方 WhatsApp 指南,可能導致帳號被停用的風險。

適用情境

  • 批量通知系統
  • 自動提醒
  • 行銷活動工具
  • 客戶聯絡
  • 事件邀請

主要特色

  • 批量訊息發送
  • 桌面平台支援
  • 瀏覽器自動化後端
  • 與 Flutter 的簡單整合
  • 會話持久性

適合對象

  • 開發桌面應用程式的開發者
  • 需要大規模訊息傳遞的團隊
  • 非商業自動化項目
  • 原型化 WhatsApp 結合

使用建議

  • 非官方 API 使用
  • 帳戶被封禁的風險
  • 需要手動設定會話
  • 僅限桌面平台
  • 無官方 WhatsApp 支援

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

WhatsApp Sender Flutter

pub package pub points pub popularity pub likes

WhatsApp Sender Flutter is an unofficial API for Flutter to send bulk messages in Whatsapp. It's not recommended using it in your company or for marketing purpose.

Buy Me A Book

Thanks to rohitsangwan01 for reference!

Getting Started

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  ...
  whatsapp_sender_flutter: latest

Import it:

import 'package:whatsapp_sender_flutter/whatsapp_sender_flutter.dart';

Configuration

For the first usage, wait for the automatic download of the .local-chromium folder in your project root. Without this folder the package will not work,this is because this package is based on puppeteer.

Basic usage

The process for sending messages is like for WhatsApp Web:

  1. Scan the qr code
  2. Start the sending
Send text message

After you have scanned the code, you can start the sending campaign.

All phones must contain the international prefix!

   await WhatsAppSenderFlutter.send(
         phones: [ "391111111", "391111111", "391111111"],
         message: "Hello",
   );
Send file message

After you have scanned the code, you can start the sending campaign.

All phones must contain the international prefix!

   await WhatsAppSenderFlutter.send(
         phones: [ "391111111", "391111111", "391111111"],
         message: "Hello",
         file: File("path-to-file.pdf"),
   );
Listen changes

New functions for listen changes:

  1. onEvent(WhatsAppSenderFlutterStatus status), usethis function to listen the sending status
  2. onQrCode(String qrCode), use this function to intercept the qrCode
  3. onSending(WhatsAppSenderFlutterCounter counter), use this function to count the number of successful or unsuccessful submissions.
  4. onError(WhatsAppSenderFlutterErrorMessage errorMessage), use this feature to catch errors while sending
   await WhatsAppSenderFlutter.send(
        phones: [ "391111111", "391111111", "391111111"],
        message: "Hello",
        file: File("path-to-file.pdf"),
        onEvent: (WhatsAppSenderFlutterStatus status) {
          print(status);
        },
        onQrCode: (String qrCode) {
          print(qrCode);
        },
        onSending: (WhatsAppSenderFlutterCounter counter) {
          print(counter.success.toString());
          print(counter.fails.toString());
        },
        onError: (WhatsAppSenderFlutterErrorMessage errorMessage) {
          print(errorMessage);
        },
   );

To know in detail the possible states of WhatsAppSenderFlutterStatus, WhatsAppSenderFlutterCounter, WhatsAppSenderFlutterErrorMessage read documentation

Save your session
   await WhatsAppSenderFlutter.send(
         phones: [ "391111111", "391111111", "391111111"],
         message: "Hello",
         savedSessionDir: "./userData"
   );

To save the session you must indicate a folder name in savedSessionDir.

If you save the session you will no longer have to scan the qr code !

Do not indicate savedSessionDir if you want to be asked to scan the qr code at each sending.

To Do

  • Send text message ✔️
  • Multi session support ✔️
  • Send files ✔️
  • Native mobile support (Android, IOS)

License

MIT

所屬分類

依賴

依賴清單 2 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。