我应该在 info-plist 中要求短信功能吗? [英] Should I require sms capabilities in the info-plist?

查看:31
本文介绍了我应该在 info-plist 中要求短信功能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 info.plist 文件中的所需设备功能"项有疑问.

I have a question about the "Required device capabilities" item in the info.plist file.

在我的应用中,用户可以使用 MFMessageComposeViewController 发送短信.所以我想知道我是否应该在 plist 中设置 sms 功能键.

In my app, user can send sms using the MFMessageComposeViewController. So I am wondering should I set the sms capability key in the plist.

我知道 iPod Touch 有 iOS 5 可以发送 iMessage.但是,我不知道带有iMessage的iPod Touch是否可以被视为具有短信"功能的设备.

I know the iPod Touch have iOS 5 could send iMessages. However, I don't know whether the iPod Touch with iMessage can be seen as the device capable of "sms".

谢谢!

推荐答案

如果您的应用程序需要编写短信才能运行,请设置使其成为必需.但是,我猜您的应用程序可以在没有 SMS 功能的情况下正常工作.在这种情况下,不要让 SMS 成为必需,而是在运行应用程序时检查可用性.如果设备可以发送消息,请允许该选项这样做,否则向用户传达该功能对他们不可用.

If composing SMS is required for your app to run, then set make it required. However, I would guess that you app can work fine without the SMS functionality. In that case, don't make SMS required, but check for availability when runnning your app. If the device can send messages, allow the option to do so, otherwise convey to the user that the feature isn't available to them.

这是一个例子:

if ([MFMessageComposeViewController canSendText]) {
   //present the controller
}
else {
   //display an alert explaining that SMS isn't available on this device
}

这篇关于我应该在 info-plist 中要求短信功能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆