5.0.0 • Published 9 months ago

@byteowls/capacitor-sms v5.0.0

Weekly downloads
12
License
MIT
Repository
github
Last release
9 months ago

Capacitor SMS plugin

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

Installation

For Capacitor v5

npm i @byteowls/capacitor-sms
npx cap sync

For Capacitor v4

npm i @byteowls/capacitor-sms@4
npx cap sync

For Capacitor v3

npm i @byteowls/capacitor-sms@3
npx cap sync

Versions

PluginFor CapacitorDocsNotes
5.x5.x.xREADMEBreaking changes see Changelog.
4.x4.x.xREADMEBreaking changes see Changelog.
3.x3.x.xREADMEBreaking changes see Changelog. XCode 12.0 needs this version
2.x2.x.xREADMEBreaking changes see Changelog. XCode 11.4 needs this version
1.x1.x.xREADME

Sponsors

I would like to especially thank some people and companies for supporting my work on this plugin and therefore improving it for everybody.

*

Maintainers

MaintainerGitHubConsulting
Michael Oberwasserlechnermoberwasserlechnerhttps://byteowls.com

Configuration

Starting with version 3.0.0, the plugin is registered automatically on all platforms.

This plugin always uses the default sms app.

Use it

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.

Platform: Android

Prerequisite: Capacitor Android Docs

Register plugin

On Android the plugin is registered automatically by Capacitor.

Platform: iOS

Register plugin

On iOS the plugin is registered automatically by Capacitor.

Platform: Web/PWA

  • Not supported.

Platform: Electron

  • Not supported.

Contribute

See Contribution Guidelines.

Changelog

See CHANGELOG.

License

MIT. Please see LICENSE.

Disclaimer

We have no business relation to Ionic.

5.0.0

9 months ago

4.0.0

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.0

4 years ago

1.0.0

5 years ago

1.0.0-beta.2

5 years ago

1.0.0-beta.1

5 years ago

1.0.0-alpha.18

5 years ago

1.0.0-alpha.17

5 years ago

1.0.0-alpha.16

5 years ago

1.0.0-alpha.15

5 years ago

1.0.0-alpha.14

5 years ago

1.0.0-alpha.13

5 years ago

1.0.0-alpha.12

6 years ago

1.0.0-alpha.11

6 years ago

1.0.0-alpha.10

6 years ago

1.0.0-alpha.9

6 years ago

1.0.0-alpha.8

6 years ago

1.0.0-alpha.7

6 years ago

1.0.0-alpha.6

6 years ago

1.0.0-alpha.5

6 years ago

1.0.0-alpha.4

6 years ago

1.0.0-alpha.3

6 years ago

1.0.0-alpha.2

6 years ago

1.0.0-alpha.1

6 years ago