パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v2.0.2

whatsapp_share

FlutterアプリからWhatsAppで特定の連絡先にメッセージ、リンク、またはファイルを共有する簡単な方法。

Android
30日間ダウンロード
131
いいね数
40
Pub ポイント
160

パッケージをインストール

flutter pub add whatsapp_share

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Android上のWhatsAppを介して特定の連絡先にメッセージ、リンク、またはファイルを直接共有できる軽量なFlutterパッケージです。事前に内容とターゲット連絡先番号を入力した状態でWhatsAppを開くプロセスを簡素化し、シームレスなコミュニケーションによりユーザー参加を促進します。このパッケージはAndroidのインテントを使用してネイティブ統合を実現し、信頼性の高い配信と最小限のセットアップを保証します。直接メッセージを通じてユーザーへのアプローチを強化したいアプリに最適です。

用途

  • 紹介リンクの共有
  • サポートメッセージの送信
  • プロモーションコンテンツの配布
  • ユーザーをカスタマーサービスに誘導する
  • フォローアップメッセージの自動化
  • メディアファイルの共有

主な機能

  • Android インテントとの簡単な統合
  • テキスト、リンク、ファイルをサポートしています
  • 特定のWhatsApp連絡先をターゲット
  • 最小構成が必要
  • ネイティブなWhatsApp機能に依存しています
  • 初期設定後はオフラインで動作します

適している対象

  • 直接的なWhatsApp連絡先へのアクセスが必要なアプリ
  • カスタマーサポート機能
  • マーケティングおよび紹介システム
  • コンテンツ配信ツール
  • ユーザーのオンボーディングフロー

注意事項

  • Android専用プラットフォームサポート
  • デバイスに WhatsApp をインストールする必要があります
  • 連絡先固有の共有に限定
  • iOS互換性なし
  • システムレベルの権限に依存します
  • 共有のためにユーザーの確認が必要になる場合があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Whatsapp Share Plugin

pub package

A Flutter plugin for Android providing a simple way to share a message, link or local files to specific WhatsApp contact.

Features:

  • Share messages or link urls to specific contact.
  • Share local files to specific contact.

Installation

First, add this to your package's pubspec.yaml file:

dependencies:
  whatsapp_share: ^1.1.1

Now in your Dart code, you can use:

import 'package:whatsapp_share/whatsapp_share.dart';

Installation (Platform Specific)

iOS

Add if not exists one row to the ios/podfile after target runner:

...

target 'Runner' do
    use_frameworks!

...
Android

If you pretends to use the file share, you need to configure the file provider, this will give access to the files turning possible to share with other applications.

Add to AndroidManifest.xml:

<application>
...
<provider
    android:name="androidx.core.content.FileProvider"
    android:authorities="${applicationId}.provider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/provider_paths"/>
</provider>
</application>

Obs: You can change the android:name if you have an extension of file provider.

Add res/xml/provider_paths.xml:

<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
    <external-path name="external_files" path="."/>
</paths>

If you want to learn more about file provider you can access:

  • https://developer.android.com/reference/android/support/v4/content/FileProvider

How to use?

Here is an snippets app displaying the two whatsapp share methods .

Whatsapp installed in this device ?
 Future<void> isInstalled() async {
    final val = await WhatsappShare.isInstalled(
      package: Package.businessWhatsapp
    );
    print('Whatsapp Business is installed: $val');
  }

If whatsapp is not installed, please do not call WhatsappShare.share() and WhatsappShare.shareFile()

Share text, links

 Future<void> share() async {
    await WhatsappShare.share(
      text: 'Whatsapp share text',
      linkUrl: 'https://flutter.dev/',
      phone: '911234567890',
    );
  }

Share images, files

_image1.path contains path of the file which is shared to the whatsapp.


 Future<void> shareFile() async {
    await WhatsappShare.shareFile(
      phone: '911234567890',
      filePath: [_image1.path, _image2.path],
    );
  }

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。