Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@byteowls/capacitor-sms

moberwasserlechner2.7kMIT6.0.0TypeScript support: included

Capacitor SMS plugin

capacitor, capacitor-plugin, sms

readme


SMS

@byteowls/capacitor-sms

Capacitor SMS plugin


Capacitor SMS plugin

Plugin for sending short messages using the device's SMS app.

Installation

npm i @byteowls/capacitor-sms
npx cap sync

Versions

Plugin For Capacitor Docs Notes
6.x 6.x.x README Breaking changes see Changelog.
5.x 5.x.x README Breaking changes see Changelog.
4.x 4.x.x README Breaking changes see Changelog.

Configuration

import {Component, OnInit} from '@angular/core';
import {SmsManager} from "@byteowls/capacitor-sms";


@Component({
    template: "<button mat-raised-button color='primary' (click)='sendSms()'>Send SMS now!</button>"
})
export class SmsExampleComponent implements OnInit {

    async ngOnInit() {
        const info: DeviceInfo = await Device.getInfo();
    }

    sendSms() {
        const numbers: string[] = ["+43 123 123123123", "+43 4564 56456456"];
        SmsManager.send({
            numbers: numbers,
            text: "This is a example SMS",
        }).then(() => {
            // success
        }).catch(error => {
            console.error(error);
        });
    }
}

Error Codes

  • SEND_CANCELLED ... User cancelled or closed the SMS app.
  • ERR_SEND_FAILED ... The SMS app returned that sending the message to the recipients failed. (ios only)
  • ERR_SEND_UNKNOWN_STATE ... The SMS app returned a unknown state. There is nothing I can do to clarify the error. (ios only)
  • UNIMPLEMENTED ... Sending SMS on the web is not supported.
  • ERR_NO_NUMBERS ... No recipient numbers were retrieved from options. Make sure to deliver only valid numbers, because the whole sending will fail.
  • ERR_NO_TEXT ... No message text was retrieved from options.
  • ERR_SERVICE_NOTFOUND ... The used device can not send SMS.

Contribute

See Contribution Guidelines.

Changelog

See CHANGELOG.

License

MIT. Please see LICENSE.

Disclaimer

We have no business relation to Ionic.

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

6.0.0 - 2024-07-25

Breaking

  • Capacitor 6.x is new minimum peer dependency! #24

5.0.0 - 2023-09-04

Breaking

  • Capacitor 5.x is new minimum peer dependency!
  • Web throws UNIMPLEMENTED code instead of ERR_PLATFORM_NOT_SUPPORTED.

4.0.0 - 2022-09-18

Breaking

  • Capacitor 4.x is new minimum peer dependency!

3.0.2 - 2022-05-02

Fixes

  • Error service not found - #14

3.0.1 - 2022-04-13

Fixes

  • Readme and Changelog links

3.0.0 - 2022-04-13

Changed

Breaking

  • Capacitor 3.x is new minimum peer dependency!

2.0.0 - 2020-04-09

Breaking

  • Capacitor 2.x is new minimum peer dependency!

1.0.0 - 2019-06-23

Breaking

  • Capacitor 1.x is new minimum peer dependency

1.0.0-beta.2 - 2019-03-07

Fixed

  • Capacitor version was pinned to beta.16 in podspec file. That prevented the capacitor upgrade to beta.18 by using npx cap sync ios

1.0.0-beta.1 - 2019-03-01

Added

  • Send SMS to more than one recipient by opening the native SMS App on Android or iOS

Breaking