【问题标题】:Ionic/cordova-sms-plugin Open sms app with longer text, Ionic toolbar disappearsIonic/cordova-sms-plugin 打开带有较长文本的短信应用,Ionic 工具栏消失
【发布时间】:2021-12-15 01:48:06
【问题描述】:
我正在使用cordova-sms-plugin 从我的ionic 应用程序发送短信。当我发送较短的文本时,一切正常,但当文本较长且短信应用程序打开时,无论我是否发送短信,返回应用程序都会隐藏工具栏。
在 Safari 中检查时,如果我将 padding-top 从 ion-safe-area-top 添加到 162px,我可以看到工具栏。
我尝试隐藏/显示状态栏,但没有成功。
ios:15
【问题讨论】:
标签:
ios
iphone
cordova
ionic-framework
【解决方案1】:
现在我已经修复了一些 CSS。
sms(phoneNumbers: string[], message: string) {
return new Promise((resolve, reject) => {
const options = {
android: {
intent: 'INTENT',
},
};
document.body.style.height = '100%';
document.body.style.marginTop = '0px';
this.smsPlugin
.send(phoneNumbers, this.parseMessage(message), options)
.then(
() => {
resolve('success');
},
() => {
reject('error');
}
)
.finally(() => {
setTimeout(() => {
const bodyHeight = document.body.offsetHeight;
const deviceHeight = window.screen.height;
document.body.style.marginTop = bodyHeight - deviceHeight + 'px';
document.body.style.height = deviceHeight + 'px';
}, 500);
});
});
}
这是 Ionic Github 上报告的错误的链接。
https://github.com/ionic-team/ionic-framework/issues/24135