पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

पैकेज विवरणv1.0.7

sms_sender_background

एक फ्लटर प्लगइन जो डुअल सिम कार्ड, अनुमति हैंडलिंग और मल्टी-पार्ट मैसेज के समर्थन के साथ एसएमएस संदेश भेजने के लिए है।

Android
30-दिन डाउनलोड
54
लाइक
15
Pub अंक
160

पैकेज इंस्टॉल करें

flutter pub add sms_sender_background

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

sms_sender_background एंड्रॉइड पर SMS संदेश भेजने के लिए डिज़ाइन किया गया एक Flutter प्लगइन है, जो डुअल सिम कार्ड, स्वचालित अनुमति प्रबंधन और बहु-भाग संदेश डिलीवरी का समर्थन करता है। यह पृष्ठभूमि प्रक्रियाओं में सहज SMS कार्यक्षमता सुनिश्चित करता है, जिससे यह उन एप्लिकेशन के लिए आदर्श है जिन्हें उपयोगकर्ता हस्तक्षेप के बिना विश्वसनीय संदेश भेजने की आवश्यकता होती है। प्लगइन एंड्रॉइड के टेलीफोनी API के साथ चिकने ढंग से एकीकृत होता है और संदेश को कई भागों में विभाजित करने और सिम चयन जैसे जटिल परिदृश्यों का प्रबंधन करता है। यह ऑटोमेटेड या योजनाबद्ध SMS नोटिफिकेशन की आवश्यकता वाले एप्लिकेशन के लिए विशेष रूप से उपयोगी है।

उपयोग

  • स्वचालित एसएमएस नोटिफिकेशन
  • डुअल सिम मैसेज रूटिंग
  • बैकग्राउंड एसएमएस डिलीवरी
  • योजनाबद्ध संदेश
  • बहुभाग SMS समर्थन
  • SMS आधारित प्रमाणीकरण

मुख्य विशेषताएँ

  • डुअल सिम कार्ड समर्थन
  • स्वचालित अनुमति प्रबंधन
  • बहुभाग संदेश प्रबंधन
  • पृष्ठभूमि निष्पादन क्षमता
  • SIM चयन नियंत्रण
  • Android-केवल संगतता

इनके लिए उपयुक्त

  • स्वचालित एसएमएस की आवश्यकता वाले ऐप्स
  • नोटिफिकेशन प्रणाली
  • द्विकारक प्रमाणीकरण
  • फील्ड सर्विस एप्लिकेशन्स
  • संदेश उपकरण
  • बैकग्राउंड टास्क इंटीग्रेशन

विचार योग्य बातें

  • Android-केवल प्लेटफॉर्म
  • रनटाइम अनुमतियों की आवश्यकता है
  • सीमित SMS कार्यक्षमता
  • कोई iOS समर्थन नहीं
  • उपकरण फोनी कार्यक्षमता पर निर्भर करता है
  • डबल सिम डिवाइस के लिए अतिरिक्त कॉन्फ़िगरेशन की आवश्यकता हो सकती है

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

SMS Sender Background

A Flutter plugin for sending SMS messages with support for dual SIM cards, permission handling, and multi-part messages.

Features

  • Send SMS messages from your Flutter app
  • Support for dual SIM cards (specify SIM slot)
  • Automatic permission handling (request and check SMS permissions)
  • Support for long messages (automatically splits into multi-part messages)
  • Error handling and status reporting

Getting Started

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  sms_sender_background: ^1.0.5
Android Setup

Add the following permissions to your Android Manifest (android/app/src/main/AndroidManifest.xml):

<uses-permission android:name="android.permission.SEND_SMS"/>
<!-- Optional: Required only for dual SIM support -->
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>

Note about READ_PHONE_STATE permission:

  • This permission is optional and only needed if you want to use dual SIM functionality
  • If not granted, the plugin will automatically fall back to using the default SIM card
  • This ensures the plugin works reliably even on devices with stricter security policies or when distributed outside Google Play
Usage
import 'package:sms_sender_background/sms_sender.dart';;

// Create an instance
final smsSender = SmsSender();

// Check SMS permission
bool hasPermission = await smsSender.checkSmsPermission();

// Request permission if needed
if (!hasPermission) {
  hasPermission = await smsSender.requestSmsPermission();
}

// Optional: Check and request READ_PHONE_STATE permission for dual SIM support
// If not granted, the plugin will use the default SIM card
bool hasPhoneStatePermission = await smsSender.checkPhoneStatePermission();
if (!hasPhoneStatePermission) {
  hasPhoneStatePermission = await smsSender.requestPhoneStatePermission();
}

// Send SMS
if (hasPermission) {
  try {
    bool success = await smsSender.sendSms(
      phoneNumber: '+1234567890',
      message: 'Hello from Flutter!',
      simSlot: 0, // Optional: specify SIM slot (0 or 1)
    );
    print('SMS sent: $success');
  } catch (e) {
    print('Error sending SMS: $e');
  }
}

Additional Features

Dual SIM Support

To send an SMS using a specific SIM card:

// Optional: Request READ_PHONE_STATE permission for dual SIM support
bool hasPhoneStatePermission = await smsSender.checkPhoneStatePermission();
if (!hasPhoneStatePermission) {
  hasPhoneStatePermission = await smsSender.requestPhoneStatePermission();
}

await smsSender.sendSms(
  phoneNumber: '+1234567890',
  message: 'Hello!',
  simSlot: 1, // Use second SIM card
);

Important Notes:

  • Dual SIM support requires the READ_PHONE_STATE permission
  • If this permission is not granted, the plugin will automatically fall back to using the default SIM card
  • This ensures compatibility across all devices, including those with stricter security policies
  • The fallback mechanism works reliably even when apps are installed from unknown sources
Long Messages

The plugin automatically handles long messages by splitting them into multiple parts:

await smsSender.sendSms(
  phoneNumber: '+1234567890',
  message: 'A very long message that will be automatically split...',
);

Error Handling

The plugin provides detailed error information through exceptions:

  • PlatformException with code "PERMISSION_DENIED" when SMS permission is not granted
  • PlatformException with code "INVALID_ARGUMENT" when phone number or message is empty
  • PlatformException with code "SMS_SEND_ERROR" when SMS sending fails

Contributing

Feel free to contribute to this project:

  1. Fork it
  2. Create your feature branch (git checkout -b feature/my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin feature/my-new-feature)
  5. Create a new Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details

श्रेणियाँ

निर्भरताएँ

निर्भरता सूची 1 आइटम

  • plugin_platform_interface^2.0.2

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट

अभी कोई डेटा उपलब्ध नहीं है।