Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/moberwasserlechner/capacitor-sms
Capacitor SMS plugin for Android and iOS.
https://github.com/moberwasserlechner/capacitor-sms
android capacitor capacitor-plugin ios shortmessages sms
Last synced: 4 days ago
JSON representation
Capacitor SMS plugin for Android and iOS.
- Host: GitHub
- URL: https://github.com/moberwasserlechner/capacitor-sms
- Owner: moberwasserlechner
- License: mit
- Created: 2018-11-16T15:11:20.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-07-25T20:38:43.000Z (6 months ago)
- Last Synced: 2025-01-07T08:12:30.814Z (11 days ago)
- Topics: android, capacitor, capacitor-plugin, ios, shortmessages, sms
- Language: Java
- Homepage:
- Size: 322 KB
- Stars: 31
- Watchers: 5
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
SMS
@byteowls/capacitor-sms
Capacitor SMS plugin# Capacitor SMS plugin
Plugin for sending short messages using the device's SMS app.
## Installation
```bash
npm i @byteowls/capacitor-sms
npx cap sync
```## Versions
| Plugin | For Capacitor | Docs | Notes |
|--------|---------------|------------------------------------------------------------------------------------|---------------------------------------------------------------|
| 6.x | 6.x.x | [README](./README.md) | Breaking changes see Changelog. |
| 5.x | 5.x.x | [README](https://github.com/moberwasserlechner/capacitor-sms/blob/5.0.0/README.md) | Breaking changes see Changelog. |
| 4.x | 4.x.x | [README](https://github.com/moberwasserlechner/capacitor-sms/blob/4.0.0/README.md) | Breaking changes see Changelog. |## Configuration
```typescript
import {Component, OnInit} from '@angular/core';
import {SmsManager} from "@byteowls/capacitor-sms";@Component({
template: "Send SMS now!"
})
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](./.github/CONTRIBUTING.md).## Changelog
See [CHANGELOG](./CHANGELOG.md).## License
MIT. Please see [LICENSE](./LICENSE).## Disclaimer
We have no business relation to Ionic.