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

phone_state のカバー
パッケージ詳細v4.0.1

phone_state

このプラグインを使用すると、AndroidまたはiOSデバイスが着信を受信しているか、および通話の状態をすばやく簡単に確認できます。

AndroidiOS
30日間ダウンロード
1.5万
いいね数
141
Pub ポイント
160

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

flutter pub add phone_state

パッケージ概要

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

phone_state パッケージは、Android および iOS デバイス上で着信通話を検出および通話状態を監視する簡単な方法を提供します。このプラグインにより、アプリが通話受信時に動的に反応できるようになり、メディア再生の一時停止やアプリ動作の調整などが可能になります。プラグインはネイティブデバイスAPIを利用し、最小限の設定でリアルタイムの通話状態更新を提供します。音声通話イベントに意識を持つ必要があるアプリケーション、たとえば音楽プレイヤー、メッセージングアプリ、または通話中に適応が必要な生産性ツールにとって理想的です。

用途

  • 着信の検出
  • 通話中にメディアを一時停止する
  • 通話中のアプリ動作の調整
  • リアルタイムで通話状態をモニタリング
  • 通話認識機能との統合

主な機能

  • リアルタイム通話状態検出
  • クロスプラットフォーム対応(Android および iOS)
  • 最小構成
  • ネイティブAPIの統合
  • 軽量で効率的

適している対象

  • メディア再生アプリ
  • 生産性ツール
  • メッセージングアプリケーション
  • 通話機能を統合したサービス
  • 通話イベントの認識が必要なアプリ

注意事項

  • 両プラットフォームで適切な権限が必要です
  • 通話状態の制限、完全な電話制御は不可
  • バックグラウンド実行の処理が必要になる可能性があります
  • Android と iOS では動作がわずかに異なります
  • 通話の発信または管理には適していません

元の README

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

DESCRIPTION

This plugin allows you to know quickly and easily if your Android or iOS device is receiving a call and to know the status of the call.

PAY ATTENTION

  • In the iOS simulator doesn't work
  • The caller phone number is only available on Android, not iOS
  • This plugin reports phone call state only. It does not answer, reject, end, or record calls, and it does not change whether other packages can capture call audio.
  • Android detects system telephony call state only. Third-party VoIP calls from apps such as Telegram or WhatsApp are not supported. iOS CallKit behavior can differ by app.
  • The iOS implementation uses CallKit. For apps distributed in regions where CallKit is restricted, including China App Store review contexts, confirm availability and territory rules with Apple before submission.
  • PhoneState.stream requires the app process to be running with an active Flutter engine and listener. It does not send callbacks after the app is terminated.
  • On Android, if PhoneState.stream does not emit, confirm READ_PHONE_STATE is declared and granted at runtime. Some OEM battery or background restrictions, including MIUI settings on Xiaomi devices, can also delay or block callbacks.

Buy Me A Coffee

HOW TO INSTALL

Flutter

Note: This version requires Flutter >= 3.44.0 and Dart >= 3.12.2. Add phone_state to your app's pubspec.yaml, not to this package's pubspec.yaml. Your app/package name must be different from phone_state.

dependencies:
  flutter:
    sdk: flutter
  phone_state: 4.0.1
Android: Added permission on manifest
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_CALL_LOG" />

READ_PHONE_STATE is required. READ_CALL_LOG is optional and only needed for caller phone numbers.

Warning: Adding READ_CALL_LOG permission, your app will be removed from the Play Store if you don't have a valid reason to use it. Read more.

iOS: Not needed permissions on info.plist

HOW TO USE

Get stream phone state status
StreamBuilder<PhoneState>(
  stream: PhoneState.stream,
  ...
Troubleshooting package conflicts

If phone_state stops receiving updates after adding another package:

  • Confirm the required Android runtime permissions are granted before listening. READ_PHONE_STATE is required, and READ_CALL_LOG is only needed for caller phone numbers.
  • Keep a single active PhoneState.stream listener for each app flow. Cancel the previous subscription before starting another one when screens, services, or background handlers change.
  • When reporting a conflict, include the other package names, platform versions, a minimal reproduction, and the relevant Flutter, Logcat, or Xcode logs.

SCREENSHOT

Write me in the GitHub issues the new features you need and, if they are approved of course, I will implement them as soon as I can.

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

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

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