
简讯
@byteowls/capacitor-sms
电容短消息插件
电容短消息插件
使用设备的短消息应用发送短消息的插件 .
安装
npm i @byteowls/capacitor-sms
npx cap sync
版本数
| 插件 | 电容 | 文档 | 页:1 |
|---|---|---|---|
| 7.x 电话 | 7.x.x (中文(简体) ) | 读取 | 正在突破更改参见 Changelog. |
| 6.x (单位:千美元) | 6.x.x (中文(简体) ) | 读取 | 正在突破更改参见 Changelog. |
配置
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);
});
}
}
错误代码
- 终止 取消... 用户取消或关闭了短消息应用.
- 错误 SEND FAILED... SMS app返回发送消息给收件人失败 。 (仅限)
- 错误 Send UNKNOWN STATE... SMS应用返回了未知状态. 我无法澄清错误。 (仅限)
- 被统一. 不支持在网上发送短消息 .
- 错误 NO NUMBERS... 无法从选项中获取收件人号码 。 确保只交付有效数字,因为整个发送都会失败.
- 错误 NO TEXT... 没有从选项中获取信件文本 .
- 错误 服务 NOTFOUND... 已使用的设备无法发送短消息 .
贡献
见 贡献准则。 。 。 .
更改日志
见 变化。 。 。 .
许可证
麻省理工学院. 请看 自由主义。 。 。 .
免责声明
我们和Ionic没有生意关系.