Giter Club home page Giter Club logo

fluttercommunity / flutter_sms Goto Github PK

View Code? Open in Web Editor NEW
243.0 11.0 178.0 41.86 MB

A Flutter plugin to Send SMS and MMS on iOS and Android. If iMessage is enabled it will send as iMessage on iOS. This plugin must be tested on a real device on iOS. Maintainer: @rodydavis

Home Page: https://fluttercommunity.github.io/flutter_sms/

License: MIT License

Ruby 23.58% Swift 13.76% Objective-C 1.28% Dart 39.64% Kotlin 17.90% HTML 3.84%
flutter ios android sms mms sms-api imessage

flutter_sms's Introduction

Flutter Community: flutter_sms

Buy Me A Coffee Donate github pages GitHub stars flutter_sms

flutter_sms

alt-text-1

Online Demo: https://fluttercommunity.github.io/flutter_sms/

Description

Flutter Plugin for sending SMS and MMS on Android and iOS. If you send to more than one person it will send as MMS. On the iOS if the number is an iPhone and iMessage is enabled it will send as an iMessage.

How To Use

You can send multiple ways:

  1. Message and No People
  2. People and No Message
  3. Message and People

This will populate the correct fields.

Example

Make sure to Install and Import the Package.

import 'package:flutter_sms/flutter_sms.dart';

Create a function for sending messages.

void _sendSMS(String message, List<String> recipents) async {
 String _result = await sendSMS(message: message, recipients: recipents)
        .catchError((onError) {
      print(onError);
    });
print(_result);
}

You can quickly send the message with this function.

String message = "This is a test message!";
List<String> recipents = ["1234567890", "5556787676"];

_sendSMS(message, recipents);

Sending Direct

WARNING, there is a narrow category of apps that can get into the play store using this feature. Using it is only advisable if you fit into this category or you intent to distribute through a third party platform

On Android, you can skip the additional dialog with the sendDirect parameter.

String message = "This is a test message!";
List<String> recipents = ["1234567890", "5556787676"];

 String _result = await sendSMS(message: message, recipients: recipents, sendDirect: true)
        .catchError((onError) {
      print(onError);
    });
print(_result);

NOTE: This also requires the SEND_SMS permission to be added to the AndroidManifest.xml

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

Screenshots

iOS SMS Android MMS
alt-text-1 alt-text-2

You can find other screenshots here.

flutter_sms's People

Contributors

acoutts avatar adarshbalu avatar alirezabeitari avatar fasikawkn avatar jeroen-meijer avatar kmcgill88 avatar knyghtryda avatar rodydavis avatar tlkops avatar zbarbuto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter_sms's Issues

Unable to send sms, currently not configured to sms error

PlatformException(device_not_capable, The current device is not capable of sending text messages., A device may be unable to send messages if it does not support messaging or if it is not currently configured to send messages. This only applies to the ability to send text messages via iMessage, SMS, and MMS., null)

I have even added the below code in Manifest-

<uses-permission android:name="android.permission.SEND_SMS" />
    <queries>
        <intent>
            <action android:name="android.intent.action.SENDTO" />
            <data android:scheme="smsto"/>
        </intent>
    </queries>

Not able to compile app with flutter_sms dependency with M1 MacBook Pro 2021 Model.

I am trying to compile app locally on AVD but getting error.

[  +37 ms] > Task :flutter_sms:compileDebugKotlin FAILED
[        ] Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
[        ] Use '--warning-mode all' to show the individual deprecation warnings.
[        ] See https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings
[        ] 141 actionable tasks: 4 executed, 137 up-to-date
[        ] e: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
[   +1 ms] e: /Users/cbindia/.gradle/caches/transforms-3/001530a160ce2f16cfc09b0518cd08db/transformed/jetified-kotlin-stdlib-jdk7-1.5.30.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] e: /Users/cbindia/.gradle/caches/transforms-3/4f734de614219efa437b45097d51db30/transformed/jetified-window-1.0.0-beta04-api.jar!/META-INF/window_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] e: /Users/cbindia/.gradle/caches/transforms-3/7c489bc67029764e7094b740450d625f/transformed/jetified-kotlinx-coroutines-core-jvm-1.5.2.jar!/META-INF/kotlinx-coroutines-core.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] e: /Users/cbindia/.gradle/caches/transforms-3/86258c1865fbbef41c634e6cbaa371e5/transformed/jetified-kotlin-stdlib-jdk8-1.5.30.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] e: /Users/cbindia/.gradle/caches/transforms-3/8b97b97961ff2113bf96b48fdd9e92cb/transformed/jetified-kotlin-stdlib-common-1.5.31.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] e: /Users/cbindia/.gradle/caches/transforms-3/c0505dfc597cfd4a8cb23d60e4f2e66a/transformed/jetified-window-java-1.0.0-beta04-api.jar!/META-INF/window-java_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] e: /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] e: /Users/cbindia/.gradle/caches/transforms-3/eb6c941766b95662cf72a7ebad35d349/transformed/jetified-kotlinx-coroutines-android-1.5.2.jar!/META-INF/kotlinx-coroutines-android.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (30, 5): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (34, 5): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (38, 5): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (42, 5): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (46, 5): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (50, 5): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (54, 5): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (55, 14): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (59, 14): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (65, 6): Class 'kotlin.jvm.JvmStatic' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/jvm/JvmStatic.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (68, 12): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (69, 12): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (74, 5): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (77, 20): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (86, 11): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (88, 32): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (89, 24): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (98, 12): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (104, 5): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (105, 7): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (108, 7): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (116, 26): Unresolved reference: split
[   +1 ms] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (119, 56): Unresolved reference: toByteArray
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (120, 7): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (120, 19): Unresolved reference: toByteArray
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (122, 21): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (124, 21): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (128, 12): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (133, 12): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (136, 15): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] e: /Users/cbindia/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.3.3/android/src/main/kotlin/com/example/flutter_sms/FlutterSmsPlugin.kt: (137, 12): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
[        ] The class is loaded from /Users/cbindia/.gradle/caches/transforms-3/c7f74e2ea19c50a422b114f964c3ce1e/transformed/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
[        ] FAILURE: Build failed with an exception.
[        ] * What went wrong:
[        ] Execution failed for task ':flutter_sms:compileDebugKotlin'.
[        ] > Compilation error. See log for more details
[        ] * Try:
[        ] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[        ] * Get more help at https://help.gradle.org
[        ] BUILD FAILED in 1s

PlatformException device_not_capable

Hello,
I put in my AndroidManifest.xml file:

and continuously get on my physical Pixel 5

PlatformException(device_not_capable, The current device is not capable of sending text messages., A device may be unable to send messages if it does not support messaging or if it is not currently configured to send messages. This only applies to the ability to send text messages via iMessage, SMS, and MMS., null)

My app requires 3 permissions: location, phone and sms. The first two the permission is granted. However for SMS I cannot request the permission and constantly returns undetermined.

My Pixel 5 can send/receive texts as normally used.

Import error

I'm trying to use the package, but after configuring and importing the package when I try to run the app the message appears:

/C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.0.1+2/lib/src/flutter_sms_platform.dart:3:8: Error: Not found: 'dart: html'
import 'dart: html' as html;

Update doc?

DOC

import 'package:flutter_sms/flutter_sms.dart';
void _sendSMS(String message, List<String> recipents) async {
 String _result = await FlutterSms
        .sendSMS(message: message, recipients: recipents)
        .catchError((onError) {
      print(onError);
    });
print(_result);
}

but not work

alternative 1:
change import

import 'package:flutter_sms/flutter_sms.dart' as FlutterSms;

with format dart warning "use 'lowercase_wiht_underscore' when specifying a library prefix"

alternative 2:
change call function without class

void _sendSMS(String message, List<String> recipents) async {
 String _result = await sendSMS(message: message, recipients: recipents)
        .catchError((onError) {
      print(onError);
    });
print(_result);
}

alternative 3:
modify "flutter_sms/lib/flutter_sms.dart" compatible/like version 1

class FlutterSms {
    static Future<String> sendSMS({
      @required String message,
      @required List<String> recipients,
    }) =>
        FlutterSmsPlatform.instance
            .sendSMS(message: message, recipients: recipients);

    static Future<bool> canSendSMS() => FlutterSmsPlatform.instance.canSendSMS();
}

TypeError: Cannot read property 'PictureRecorder' of undefined

This happens if you just add the package to your pubspec (you don't even have to use it) and run for flutter web.
This does not prevent the app for starting, but it is polluting our sentry instance with weird errors.

If you want to reproduce it just create a new app and add flutter_sms: ^2.3.1 to your pubspec, then do flutter run -d chrome.

I think you should just return false in canSendSMS() instead of throwing this monster.

TypeError: Cannot read property 'PictureRecorder' of undefined
    at _engine.CkPictureRecorder.new.beginRecording (http://localhost:36985/dart_sdk.js:135664:82)
    at Function.new (http://localhost:36985/dart_sdk.js:130810:56)
    at Function.new (http://localhost:36985/dart_sdk.js:122055:43)
    at DefaultShaderWarmUp.execute (http://localhost:36985/packages/flutter/src/painting/shader_warm_up.dart.lib.js:115:35)
    at execute.next (<anonymous>)
    at runBody (http://localhost:36985/dart_sdk.js:37228:34)
    at Object._async [as async] (http://localhost:36985/dart_sdk.js:37259:7)
    at DefaultShaderWarmUp.execute (http://localhost:36985/packages/flutter/src/painting/shader_warm_up.dart.lib.js:113:20)
    at binding$5.WidgetsFlutterBinding.new.initInstances (http://localhost:36985/packages/flutter/src/painting/binding.dart.lib.js:75:30)
    at binding$5.WidgetsFlutterBinding.new.initInstances (http://localhost:36985/packages/flutter/src/semantics/binding.dart.lib.js:41:13)
    at binding$5.WidgetsFlutterBinding.new.initInstances (http://localhost:36985/packages/flutter/src/rendering/layer.dart.lib.js:5918:13)
    at binding$5.WidgetsFlutterBinding.new.initInstances (http://localhost:36985/packages/flutter/src/widgets/widget_span.dart.lib.js:50901:13)
    at binding$5.WidgetsFlutterBinding.new.binding.BindingBase.new (http://localhost:36985/packages/flutter/src/foundation/binding.dart.lib.js:371:10)
    at binding$5.WidgetsFlutterBinding.new.BindingBase_GestureBinding$36.new (http://localhost:36985/packages/flutter/src/widgets/widget_span.dart.lib.js:51478:49)
    at binding$5.WidgetsFlutterBinding.new.BindingBase_SchedulerBinding$36.new (http://localhost:36985/packages/flutter/src/widgets/widget_span.dart.lib.js:51484:51)
    at binding$5.WidgetsFlutterBinding.new.BindingBase_ServicesBinding$36.new (http://localhost:36985/packages/flutter/src/widgets/widget_span.dart.lib.js:51490:50)
    at binding$5.WidgetsFlutterBinding.new.BindingBase_PaintingBinding$36.new (http://localhost:36985/packages/flutter/src/widgets/widget_span.dart.lib.js:51496:50)
    at binding$5.WidgetsFlutterBinding.new.BindingBase_SemanticsBinding$36.new (http://localhost:36985/packages/flutter/src/widgets/widget_span.dart.lib.js:51502:51)
    at binding$5.WidgetsFlutterBinding.new.BindingBase_RendererBinding$36.new (http://localhost:36985/packages/flutter/src/widgets/widget_span.dart.lib.js:51508:50)
    at binding$5.WidgetsFlutterBinding.new.BindingBase_WidgetsBinding$36.new (http://localhost:36985/packages/flutter/src/widgets/widget_span.dart.lib.js:51514:49)
    at new binding$5.WidgetsFlutterBinding.new (http://localhost:36985/packages/flutter/src/widgets/widget_span.dart.lib.js:51524:51)
    at Function.ensureInitialized (http://localhost:36985/packages/flutter/src/widgets/widget_span.dart.lib.js:51519:54)
    at Function.registerWith (http://localhost:36985/packages/flutter_sms/flutter_sms_web.dart.lib.js:34:37)
    at Object.registerPlugins (http://localhost:36985/packages/flutter_ck_picture_recorder/generated_plugin_registrant.dart.lib.js:31:38)
    at main (http://localhost:36985/web_entrypoint.dart.lib.js:41:35)
    at main.next (<anonymous>)
    at runBody (http://localhost:36985/dart_sdk.js:37228:34)
    at Object._async [as async] (http://localhost:36985/dart_sdk.js:37259:7)
    at main$ (http://localhost:36985/web_entrypoint.dart.lib.js:40:18)
    at http://localhost:36985/main_module.bootstrap.js:19:10
    at Array.forEach (<anonymous>)
    at window.$dartRunMain (http://localhost:36985/main_module.bootstrap.js:18:32)
    at <anonymous>:1:8
    at Object.runMain (http://localhost:36985/dwds/src/injected/client.js:8656:21)
    at http://localhost:36985/dwds/src/injected/client.js:22068:19
    at _wrapJsFunctionForAsync_closure.$protected (http://localhost:36985/dwds/src/injected/client.js:3830:15)
    at _wrapJsFunctionForAsync_closure.call$2 (http://localhost:36985/dwds/src/injected/client.js:10905:12)
    at Object._asyncStartSync (http://localhost:36985/dwds/src/injected/client.js:3794:20)
    at main__closure1.$call$body$main__closure (http://localhost:36985/dwds/src/injected/client.js:22080:16)
    at main__closure1.call$1 (http://localhost:36985/dwds/src/injected/client.js:22007:19)
    at StaticClosure._rootRunUnary [as call$2$5] (http://localhost:36985/dwds/src/injected/client.js:4153:16)
    at _CustomZone.runUnary$2$2 (http://localhost:36985/dwds/src/injected/client.js:12136:39)
    at _CustomZone.runUnaryGuarded$1$2 (http://localhost:36985/dwds/src/injected/client.js:12068:14)
    at _ControllerSubscription._sendData$1 (http://localhost:36985/dwds/src/injected/client.js:11697:19)
    at _DelayedData.perform$1 (http://localhost:36985/dwds/src/injected/client.js:11849:59)
    at _PendingEvents_schedule_closure.call$0 (http://localhost:36985/dwds/src/injected/client.js:11898:14)
    at Object._microtaskLoop (http://localhost:36985/dwds/src/injected/client.js:3990:24)
    at StaticClosure._startMicrotaskLoop (http://localhost:36985/dwds/src/injected/client.js:3996:11)
    at _AsyncRun__initializeScheduleImmediate_internalCallback.call$1 (http://localhost:36985/dwds/src/injected/client.js:10774:9)
    at invokeClosure (http://localhost:36985/dwds/src/injected/client.js:1250:26)
    at MutationObserver.<anonymous> (http://localhost:36985/dwds/src/injected/client.js:1269:18)

Documentation improvements

Gentlefolk.
Can I ask for some documentation improvements.

  1. what is the difference between sendSMS and launchSMS?
  2. what actions are required to support dual sim cards.
  3. the values return by sendSMS and launchSMS

[Dependancies] plugin_platform_interface 2.0.0

Hello,

Currently flutter_sms depends on plugin_platform_interface 1.0.1, but as firebase_messaging >=9.0.0 depends on firebase_messaging_platform_interface ^2.0.0, it makes them unusable together.
Would that take a lot of work to bump this dependancy version to 2.0.0?

Not using SmsManager for direct SMS transmission

This is not an issue, but please update your code for using direct SMS transmission (without popup or additional view).
It is more user friendly without additional popup for pre-edit the sms content.
Why user must see the edit page, if the app already prepared the content for the sms?

await sendSMS(...) should send SMS directly without delay or sms popup edit page.

In Android you can do:

// SmsManager is android.telephony
String destinationAddress = "35235235;235423523";
String msg = "Text to send bla bla bla";
PendingIntent sentIntent = PendingIntent.getBroadcast(this, 0, new Intent("SMS_SENT_ACTION"), 0);
SmsManager mSmsManager = SmsManager.getDefault();
String numbers[] = destinationAddress.split(";");

for(String num : numbers) {
Logger.d(this, "msg.length() : " + msg.getBytes().length);
if(msg.getBytes().length > 80) {
ArrayList partMessage = mSmsManager.divideMessage(msg);
mSmsManager.sendMultipartTextMessage(num, null, partMessage, null, null);
}else {
mSmsManager.sendTextMessage(num, null, msg, sentIntent, null);
}
}

Thank you in advance.

demo not working for me

I tried:
10 digit number xxx-xxx-xxxx
with country code in front 1 for Canada
and for emailing to sms for my carrier: <10 digit number>@txt.bell.ca

None of them arrived. From both Firefox and Chrome on Ubuntu. Firefox asked to open some KDE app and Chrome did its own thing.
https://fluttercommunity.github.io wants to open this application. to which I clicked Open-xdg-open.

duplicate message

Hi!
In Android 8, the message that arrives at the sms application is duplicated (it appears twice the initially set message).
On Android 9 and 10 is ok.

It may have something to do with putting twice the message in the intent.putExtra:

private fun sendSMS(result: Result, phones: String?, message: String?) {
    val intent = Intent(Intent.ACTION_SENDTO)
    intent.data = Uri.parse("smsto:$phones")
    intent.putExtra("sms_body", message)
    intent.putExtra(Intent.EXTRA_TEXT, message)
    activity?.startActivityForResult(intent, REQUEST_CODE_SEND_SMS)

  }

Doesn't work on latest updates with pixel4xl

I tested it there, and always says blocked by appsfliter. I did manage to get one plugin to work and that was the telephony one, so I guess I'm just suggesting to look at that code and implement it here if you can.

Platform NullPointerException when calling sendSMS() headless

Hello,

Flutter Doctor output:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.0.5, on Microsoft Windows [Version 10.0.19041.928], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] VS Code (version 1.56.0)
[√] Connected device (4 available)

Error stack trace:

 *** ERR: (null ctxt) Exception occurred when sending SMS message: PlatformException(error, null, null, kotlin.KotlinNullPointerException
I/flutter (20578):      at com.example.flutter_sms.FlutterSmsPlugin.canSendSMS(FlutterSmsPlugin.kt:58)
I/flutter (20578):      at com.example.flutter_sms.FlutterSmsPlugin.onMethodCall(FlutterSmsPlugin.kt:39)
I/flutter (20578):      at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
I/flutter (20578):      at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
I/flutter (20578):      at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
I/flutter (20578):      at android.os.MessageQueue.nativePollOnce(Native Method)
I/flutter (20578):      at android.os.MessageQueue.next(MessageQueue.java:335)
I/flutter (20578):      at android.os.Looper.loop(Looper.java:206)
I/flutter (20578):      at android.app.ActivityThread.main(ActivityThread.java:8512)
I/flutter (20578):      at java.lang.reflect.Method.invoke(Native Method)
I/flutter (20578):      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
I/flutter (20578):      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
I/flutter (20578): )
I/flutter (20578): Stack trace

Scenario:
My app runs a headless process that I'd like to send an SMS message from. Any guidance for out to get your plugin (or any plugin to do this in a headless fashion) is greatly appreciated.

_sendSMS does not send the sms/mms, only loads into the phone's message app.

This plugin is great!

I only have one questions:
The _sendSMS method does not actually send the message to the recipients. It only loads the message and recipients into the Android message app, ready for sending. The user has to manually send the message.
Is this by design?
I need the message to be sent automatically, without any user intervention...

possibility to send SMS silently

The plugin opens the SMS app, it then requires another tap to send the sms.

I would like to have the possibility to send the sms silently from my flutter app without having it going to the background.

thx.

Unable to run on Xcode

I have imported and installed version 1.1.0 which works fine in Android. However when I try to open the project in Xcode and then run I get an error message Module flutter_sms not found.

Not working from web

When launched from a web app (running on chrome on android), the sms app is launched but the phone number and body are not populated.

Android Messages app opens on call to `sendSMS`

I created a new Flutter app today and added the permission_handler and flutter_sms packages. When the app sends the SMS message, the device's Messages app opens to the selected recipient with the message text in the input box ready to send. I have to tap the send button to send the SMS. Is this expected behavior?

Here's my Flutter environment:

Flutter 3.0.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision cd41fdd495 (9 days ago) • 2022-06-08 09:52:13 -0700
Engine • revision f15f824b57
Tools • Dart 2.17.3 • DevTools 2.12.2

and here's the code that sends the message:

Future<void> _sendSMS(String msg) async {
    bool result;
    String targetName;
    String targetPhone;
    List<String> recipients = [];

    // Can the device send SMS?
    result = await canSendSMS();
    if (!result) {
      logMessage("Device cannot send SMS messages");
      return;
    }
    log.info("Device can send SMS messages");

    // Do we have permission to send SMS?
    result = await Permission.sms.request().isGranted;
    if (!result) {
      logMessage("Permission denied");
      return;
    }
    log.info("Permission granted");

    // Populate the target name and phone number variables
    if (_isTest) {
      targetName = Strings.targetNameDev;
      targetPhone = Strings.targetPhoneDev;
    } else {
      targetName = Strings.targetNameProd;
      targetPhone = Strings.targetPhoneProd;
    }
    log.info("Sending message to $targetName ($targetPhone)");
    recipients.clear();
    recipients.add(targetPhone);
    try {
      String result = await sendSMS(
        message: msg,
        recipients: recipients,
        sendDirect: sendDirect,
      );
      log.info(result);
    } catch (error) {
      log.info(error.toString());
    }
  }

nnbd prerelease

As google is now calling for pre-releases of packages with null safety implemented I was hoping we would see an nnbd pre-release of flutter_sms.

Just a question or feature request

I use other package to send sms without opening sms manager to android.
I use the package to open sms dialog inios and send predefined phone number and sms message:
void _sendSMS(String message, String number) async { bool _result = await launchSms(message: message, number: number) .catchError((onError) { print(onError); }); print(_result); } String message = "Sender has a car issue.\n" "Date-time at ${DateTime.now()}\n" "Location:\n" "$mapLink"; String number = bookerPhone;
It works as expected, but
is there a way to return to the app after the user sends the sms?

Android always says "SMS Sent!"

On iOS when I try to send a message I receive as a result either "sent" or "cancelled" but when on Android I always get "SMS Sent!" no matter what I do.

Android embedding warning on Flutter Master branch

The plugins flutter_sms use a deprecated version of the Android embedding.

To avoid unexpected runtime failures, or future build failures, try to see if these plugins support the Android V2 embedding. Otherwise, consider removing them since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.

[✓] Flutter (Channel master, 2.4.0-5.0.pre.144, on macOS 11.4 20F71 darwin-x64,
    locale en-ZA)
    • Flutter version 2.4.0-5.0.pre.144 at /Users/theunodebruin/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7f26dbe0d4 (46 minutes ago), 2021-07-21 21:51:06 -0700
    • Engine revision 2c9000e28c
    • Dart version 2.14.0 (build 2.14.0-341.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/theunodebruin/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: /Users/theunodebruin/Library/Application
      Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/202.7486908/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /Users/theunodebruin/Library/Application
      Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/202.7486908/Android
      Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[✓] Android Studio (version 4.2)
    • Android Studio at /Users/theunodebruin/Library/Application
      Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/202.7486908/Android
      Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[✓] IntelliJ IDEA Ultimate Edition (version 2021.1.3)
    • IntelliJ at /Users/theunodebruin/Applications/JetBrains Toolbox/IntelliJ
      IDEA Ultimate.app
    • Flutter plugin version 58.0.3
    • Dart plugin version 211.7727

[✓] IntelliJ IDEA Ultimate Edition (version 2021.1.3)
    • IntelliJ at /Users/theunodebruin/Library/Application
      Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/211.7628.21/IntelliJ IDEA.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] Connected device (2 available)
    • iPhone 12 Pro Max (mobile) • 903ED170-BCC4-482B-814A-DBBACD7A0FDE • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • Chrome (web)               • chrome                               •
      web-javascript • Google Chrome 91.0.4472.164

• No issues found!

Cant build ios app - `SWIFT_VERSION` issue

Hello!

Everything works on Android but on iOS I cant build the project. There's an issue with the swift version, this is the output I get:

      - Running pre install hooks
    [!] Unable to determine Swift version for the following pods:

    - `flutter_sms` does not specify a Swift version and none of the targets (`Runner`) integrating it have the
    `SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in at least one of the
    targets that integrate this pod.

    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/installer/xcode/target_validator.rb:122:in
    `verify_swift_pods_swift_version'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/installer/xcode/target_validator.rb:37:in `validate!'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/installer.rb:578:in `validate_targets'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/installer.rb:158:in `install!'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/command/install.rb:51:in `run'
    /Library/Ruby/Gems/2.3.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:22:in `load'
    /usr/local/bin/pod:22:in `<main>'

I found a potential answer here, followed the steps but I still cant build the ios app because of this plugin. Any suggestions?

dual simcard support

Does this package support dual simcard for android? If so, please provide code that can be helpful for that cause.

sendSMS change result to enum instead of string

I noticed you return a Future<String> from sendSMS. What do you think about changing to Future<SendResult>.

String _result = await FlutterSms.sendSMS(message: "yo dawg", recipients: ["1234567890"]);
print("Result is: $_result");
if (_result == "not clear what the result options are") {
// stuff
}

to

SendResult _result = await FlutterSms.sendSMS(message: "yo dawg", recipients: ["1234567890"]);
print("Result is: $_result");
if (_result == SendResult.success) {
// stuff
}

Doing something like SendResult.success would allow pushing the string comparison down into your library and consumers have an easier interface with the enums to determine the result. I'd be happy to implement this if you agree.

Is this default SMS app opener

Last 2 screenshot of documentation confuse me. Why there are default SMS app's of android and iOS .Can this package send SMS without interaction of those apps

Android build fails due to "import 'dart:html'"

Building flutter_sms: ^2.0.1+2 for Android fails with the following message:

Compiler message:
../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sms-2.0.1+2/lib/src/flutter_sms_platform.dart:3:8: Error: Not found: 'dart:html'
import 'dart:html' as html;
^

Flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v1.17.0, on Mac OS X 10.15.3 19D76, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.6)
[✓] Connected device (2 available)

• No issues found!

iOS should check if device canSendText

Hi great work!

I noticed you are presenting the MFMessageComposeViewController without checking MFMessageComposeViewController.canSendText() here.

Apple says
Always call this method before attempting to present the message compose view controller. A device may be unable to send messages if it does not support messaging or if it is not currently configured to send messages. This method applies only to the ability to send text messages via iMessage, SMS, and MMS.

If you are open to PR's I'd be happy to contribute.

编译出错

Compiler message:
../lib/src/flutter_sms_platform.dart:3:8: Error: Not found: 'dart:html'
import 'dart:html' as html;
^
../lib/src/flutter_sms_platform.dart:90:27: Error: Getter not found: 'window'.
final _agent = html.window.navigator.userAgent;
^^^^^^

Compiler message:
../lib/src/flutter_sms_platform.dart:3:8: Error: Not found: 'dart:html'
import 'dart:html' as html;

iOS sendSMS's result message is incorrect

This line is called immediately,...before a sent, canceled or failed is returned by iOS.

I believe you want to move the result callback to send back the actual result provided by MessageComposeResult.

If you are open to PR's I'd be happy to contribute.

Implemetation

It is not an issue. But i am requesting to implement to send a file also as like string through sms.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.