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

パッケージ詳細v0.0.4

background_sms

主な目的は、バックグラウンドおよびヘッドレス状態からSMSを送信することです。アプリ内、バックグラウンド、またはヘッドレス状態であっても、SMSを送信できます。

AndroidiOS
30日間ダウンロード
178
いいね数
70
Pub ポイント
140

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

flutter pub add background_sms

パッケージ概要

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

background_sms パッケージは、デバイスがロックされているか、アプリがフォアグラウンドで実行中か、バックグラウンドで実行中かに関係なく、アプリのバックグラウンドまたはヘッドレス状態からSMSメッセージを送信できるようにします。ユーザーの操作なしに信頼性の高い自動SMS配信が必要なユースケース向けに設計されています。このパッケージはAndroidおよびiOSプラットフォームをサポートしていますが、プラットフォーム固有の制限により機能が異なる場合があります。Flutterとの統合はシンプルなAPIを通じて行われ、アプリがアクティブに開いていなくてもSMS送信をトリガーできます。

用途

  • 自動OTP配信
  • 緊急警報システム
  • リモートデバイス制御
  • スケジュールされたメッセージブロードキャスト
  • サービス状態の通知

主な機能

  • バックグラウンドSMS送信
  • ヘッドレス実行のサポート
  • クロスプラットフォーム(AndroidおよびiOS)
  • シンプルなAPI統合
  • 信頼できるメッセージ配信

適している対象

  • サイレントSMSの自動化が必要なアプリ
  • オフラインメッセージのトリガーを必要とするサービス
  • IoTデバイス通信
  • セキュリティおよびモニタリングアプリケーション

注意事項

  • iOS には制限されたバックグラウンド実行機能があります
  • 適切な権限とユーザーの承認が必要です
  • キャリアのポリシーにより制限される可能性があります
  • 高ボリュームのメッセージには適していません
  • デバイスメーカーのSMS処理に依存します

元の README

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

Background SMS

This is an SMS library for flutter. You can send SMS from foreground, background, and headless.

It only support Android for now.

Installation and Usage

Add background_sms to the dependencies list of the pubspec.yaml file as follow:

dependencies:
  flutter:
    sdk: flutter

  background_sms: ^0.0.1

Then run the command flutter packages get on the console.

First add permission to send sms in AndroidManifest.xml.

<uses-permission android:name="android.permission.SEND_SMS" />

Then request permission for send sms.Use Permission Handler or something other.

Import

import 'package:background_sms/background_sms.dart';

Simply send sms with default sim.

  String result = await BackgroundSms.sendMessage(
     phoneNumber: "09xxxxxxxxx", message: "Message");
    if (result == SmsStatus.sent) {
      print("Sent");
    } else {
      print("Failed");
    }

Send with custom sim slot 1 for sim1, 2 for sim2 and so on.

  String result = await BackgroundSms.sendMessage(
     phoneNumber: "09xxxxxxxxx", message: "Message", simSlot: 1);
    if (result == SmsStatus.sent) {
      print("Sent");
    } else {
      print("Failed");
    }

You can check Custom Sim Slot is support from Native Android.

  bool result = await BackgroundSms.isSupportCustomSim;
    if (result) {
      print("Support Custom Sim Slot");
        String result = await BackgroundSms.sendMessage(
        phoneNumber: "09xxxxxxxxx", message: "Message", simSlot: 1);
        if (result == SmsStatus.sent) {
          print("Sent");
        } else {
          print("Failed");
        }
    } else {
      print("Not Support Custom Sim Slot");
        String result = await BackgroundSms.sendMessage(
        phoneNumber: "09xxxxxxxxx", message: "Message");
        if (result == SmsStatus.sent) {
          print("Sent");
        } else {
          print("Failed");
        }
    }

Platform Detail

Flutter 2.8.1 • channel stable • https://github.com/flutter/flutter.git Framework • revision 77d935af4d (2 months ago) • 2021-12-16 08:37:33 -0800 Engine • revision 890a5fca2e Tools • Dart 2.15.1

Created by

Shine Wanna

カテゴリー

ソースリポジトリ

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

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