패키지, 저장소 및 앱 카테고리 검색

패키지 상세v2.0.2

whatsapp_share

Flutter 앱에서 WhatsApp로 특정 연락처에게 메시지, 링크 또는 파일을 공유하는 간단한 방법입니다.

Android
30일 다운로드
131
좋아요
40
Pub 점수
160

패키지 설치

flutter pub add whatsapp_share

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

안드로이드에서 WhatsApp를 통해 특정 연락처에게 메시지, 링크 또는 파일을 직접 공유할 수 있는 가벼운 플러터 패키지입니다. 사전에 채워진 내용과 대상 연락처 번호와 함께 WhatsApp를 열어주는 과정을 단순화하여 원활한 통신을 통해 사용자 참여도를 높입니다. 이 패키지는 안드로이드 인텐트를 활용해 네이티브 통합을 구현하여 신뢰성 있는 전달과 최소한의 설정을 보장합니다. 직접 메시지를 통해 사용자 접근성을 향상시키고자 하는 앱에 이상적입니다.

사용 사례

  • 추천 링크 공유
  • 지원 메시지 보내기
  • 프로모션 콘텐츠 배포
  • 사용자에게 고객 서비스로 안내하기
  • 팔로우업 메시지 자동화
  • 미디어 파일 공유

주요 기능

  • Android 인텐트와의 간편한 통합
  • 텍스트, 링크 및 파일을 지원합니다
  • 특정 월마트 연락처 대상
  • 필수 최소 구성
  • 네이티브 웍스앱 기능에 의존
  • 초기 설정 후 오프라인에서 작동

적합한 대상

  • 직접 WhatsApp 연락처에 접근이 필요한 앱
  • 고객 지원 기능
  • 마케팅 및 추천 시스템
  • 콘텐츠 배포 도구
  • 사용자 온보딩 흐름

고려 사항

  • 안드로이드 전용 플랫폼 지원
  • 기기에서 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],
    );
  }

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.