首页 \ 问答 \ 在Swift中,发送短信失败但MFMessageComposeViewController委托显示已发送(In Swift, Failed to send SMS but MFMessageComposeViewController Delegate Show sent)

在Swift中,发送短信失败但MFMessageComposeViewController委托显示已发送(In Swift, Failed to send SMS but MFMessageComposeViewController Delegate Show sent)

我正在使用MFMessageComposeViewController从我的应用程序发送短信。

MFMessageComposeViewControllerdidFinishWithResult委托方法显示消息已成功发送,但实际上由于余额不足,此SMS无法发送。 所以MFMessageComposeViewController没有显示正确的结果。

我怎么知道消息应用程序无法发送短信? 有没有办法获得失败的身份?


I am using MFMessageComposeViewController to send SMS from my app.

The didFinishWithResult delegate method of MFMessageComposeViewController shows that the message has been sent successfully but actually this SMS failed to send due to insufficient balance. So MFMessageComposeViewController does not show me the correct result.

How do I know that the Messages app failed to send an SMS? Is there any way to get the failed status?


原文:https://stackoverflow.com/questions/41993970
更新时间:2023-12-09 10:12

最满意答案

调用

t.run();

只需在当前线程(可能是FX Application线程)上调用run()方法。 要开始一个新的线程,你需要打电话

t.start();

假设threadclass (sic)是Thread一个子类。


Calling

t.run();

simply invokes the run() method on the current thread (which is probably the FX Application thread). To start a new thread, you need to call

t.start();

assuming threadclass (sic) is a subclass of Thread.

相关问答

更多
  • 当你使用for循环时,它会尝试尽可能快地做你正在做的事情。 新的Showtime()。execute()不是阻塞调用,所以,你基本上会产生成千上万的线程加载图像,并且很快就会耗尽内存。 所以...假设Showtime是您的AsyncTask,您希望在该任务完成时触发图像显示的下一次迭代。 删除for()循环,只需使用Task作为显示图像的调度程序,然后等待,然后显示下一个。 此外,如果没有看到你的堆栈跟踪,就不可能知道你可能做错了什么,但我理所当然地认为你正在正确加载你的位图(你很可能不会这样)。 [编辑] ...
  • 通过以下方式加载图像来解决此问题: //Loading image with placeholder and error image imageLoader.get(Const.URL_IMAGE, ImageLoader.getImageListener( imageView, R.drawable.ico_loading, R.drawable.ico_error)); Fixed the issue by loading the image in below way: //L ...
  • 你像这样初始化imageView iv = new ImageView(ctx); 你应该像这样iv = (ImageView) findViewById(R.id.mImageView); Finally i got my problem solved. Issue was not in DCIM folder, issue was in size. The pictures taken from cell phone camera is very high and gallery was not get ...
  • 您应该检查图像是否已下载,如果已下载,则可以使用ui线程更新UI mainActivity.this.runOnUiThread(new Runnable() { public void run() { ImageView imgView = (ImageView) findViewById(R.id.imageView1); imgView.setImageBitmap(BitmapFactory.decodeFile(getFilesDir() + "/" +TEM ...
  • 您没有为ImageView指定高度。 var image = Ti.UI.createImageView({ image: '/images/name.png', width:200, height: Ti.UI.SIZE }); 如果你想让它成为动态的(如果你还不知道高度)或者给它一个固定的高度,可以使它成为Ti.UI.SIZE 。 You did not specify a height for the ImageView. var image = Ti.UI.createIm ...
  • 把你想要的回声放入一个在foreach之外声明的单个变量,并将每个div连接起来(每个循环对应一个foreach)。 然后在循环后回显它。 $boxitems = $_POST['box']; $insertedItems = array(); $duplicateItems = array(); foreach ($boxitems as $boxes) { $escapedBoxes = mysqli_real_escape_string($conn, $boxes); $sq ...
  • 这与bootstrap无关,你正在用错误的剃刀语法分配唯一的id。 通常在剃刀中,当你用字符串编写c#代码时,该代码被视为字符串。 一个简单的解决方案是将c#代码封装在@() 。 所以,你需要像这样分配唯一的ID: ... data-target="#Modal@(itm.PostImageGalleryId)" ... 和 ... id="Modal@(itm.PostImageGalleryId)"... This has nothing to do with boots ...
  • 调用 t.run(); 只需在当前线程(可能是FX Application线程)上调用run()方法。 要开始一个新的线程,你需要打电话 t.start(); 假设threadclass (sic)是Thread一个子类。 Calling t.run(); simply invokes the run() method on the current thread (which is probably the FX Application thread). To start a new thread, ...
  • 我想你需要break; 在case CHOOSE_PHOTO_REQUEST:之前case CHOOSE_PHOTO_REQUEST: 。 这是一个可选项,但不幸的是,确定输出文件名完全取决于相机应用程序在设备上安装或用户选择的内容,即使它在MediaStore.EXTRA_OUTPUT指定。 因此除了data.getData()之外,您还应该看到data.getParcelableExtra(Intent.EXTRA_STREAM)和data.getData() 。 I guess you need br ...
  • 上面返回的ImageView存储在一个名为icon的字段中。字段用于以下代码中...... ImageView是Node的类型。 一个节点一次只能有一个父节点! 所以不要存储/缓存ImageView(-Node)。 创建新的ImageView节点。 编辑: 正如James_D的评论所指出的那样: ...你可以为每个ImageView使用相同的Image (-Object)... the ImageView returned above is stored into a field called icon.T ...

相关文章

更多

最新问答

更多
  • 如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
  • linux的常用命令干什么用的
  • 由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
  • 如何交换返回集中的行?(How to swap rows in a return set?)
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • 使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
  • Java中的不可变类(Immutable class in Java)
  • WordPress发布查询(WordPress post query)
  • 如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
  • 是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
  • GEP分段错误LLVM C ++ API(GEP segmentation fault LLVM C++ API)
  • 绑定属性设置器未被调用(Bound Property Setter not getting Called)
  • linux ubuntu14.04版没有那个文件或目录
  • 如何使用JSF EL表达式在param中迭代变量(How to iterate over variable in param using JSF EL expression)
  • 是否有可能在WPF中的一个单独的进程中隔离一些控件?(Is it possible to isolate some controls in a separate process in WPF?)
  • 使用Python 2.7的MSI安装的默认安装目录是什么?(What is the default installation directory with an MSI install of Python 2.7?)
  • 寻求多次出现的表达式(Seeking for more than one occurrence of an expression)
  • ckeditor config.protectedSource不适用于editor.insertHtml上的html元素属性(ckeditor config.protectedSource dont work for html element attributes on editor.insertHtml)
  • linux只知道文件名,不知道在哪个目录,怎么找到文件所在目录
  • Actionscript:检查字符串是否包含域或子域(Actionscript: check if string contains domain or subdomain)
  • 将CouchDB与AJAX一起使用是否安全?(Is it safe to use CouchDB with AJAX?)
  • 懒惰地初始化AutoMapper(Lazily initializing AutoMapper)
  • 使用hasclass为多个div与一个按钮问题(using hasclass for multiple divs with one button Problems)
  • Windows Phone 7:检查资源是否存在(Windows Phone 7: Check If Resource Exists)
  • 无法在新线程中从FREContext调用getActivity()?(Can't call getActivity() from FREContext in a new thread?)
  • 在Alpine上升级到postgres96(/ usr / bin / pg_dump:没有这样的文件或目录)(Upgrade to postgres96 on Alpine (/usr/bin/pg_dump: No such file or directory))
  • 如何按部门显示报告(How to display a report by Department wise)
  • Facebook墙贴在需要访问令牌密钥后无法正常工作(Facebook wall post not working after access token key required)
  • Javascript - 如何在不擦除输入的情况下更改标签的innerText(Javascript - how to change innerText of label while not wiping out the input)
  • WooCommerce / WordPress - 不显示具有特定标题的产品(WooCommerce/WordPress - Products with specific titles are not displayed)