ios - 在 Ionic 3 for IOS 中读取 SMS
问题描述
我们有一个 Ionic 应用程序,我们需要在其中读取带有验证码的 SMS,用户在注册应用程序时将收到该验证码。
我们正在使用这个在Android中完美运行的插件。但似乎不适用于IOS。
我也看过这个Native 插件,但我认为它不支持阅读短信。
这就是我们阅读短信的方式:
...
declare let SMS: any;
readListSMS() {
let filter = {
box: 'inbox', // 'inbox' (default), 'sent', 'draft'
address: '<phone-number>',
indexFrom: 0, // start from index 0
maxCount: 1, // count of SMS to return each time
read: 0
};
if (SMS) {
SMS.listSMS(filter,
(smss) => {
// Here we have access to those sms
},
error => {
alert('error list sms: ' + error);
}
);
}
}
...
问题是在为 ios 构建应用程序时它不会读取短信,实际上它甚至没有进入回调。
从我读过的内容来看,这不可能,互联网上也没有太多关于这个主题的信息!
我的问题是:
- 和ios权限有关系吗?如果是这样,任何帮助都会很好!
- 有人知道为 IOS 完成此任务的方法吗?
解决方案
推荐阅读
- reactjs - 从故事书中的类型创建控件
- google-cloud-platform - 使用上传云存储操作替换文件夹
- python - 这个列表理解如何成为 Python3 中的一个衬里?
- docker - “--from=builder”在 Dockerfile 中做了什么
- javascript - 如何在 NuxtJS 的 asyncData 中使用 Promise
- html - 无法居中社交页脚
- swift - 为什么我的 SwiftUI 视图不会在更新 @State var 时更新?
- reactjs - 为什么 ReactJS 路由器上的重定向标签不起作用?
- django - 使用 django 信号发送电子邮件时使用 django celery 的问题?
- javascript - 如何在一张幻灯片中制作包含多个图像的幻灯片