iPhone:如何以编程方式响应短信

编程入门 行业动态 更新时间:2024-10-23 19:29:43
本文介绍了iPhone:如何以编程方式响应短信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在查看iPhone SDK文档后,我 not 仍未找到一种编写应用程序的方式,从而可以以编程方式处理传入内容iPhone平台内的SMS消息.想法是让这样的应用程序在后台运行 ,并基于特定格式的SMS消息能够采取特定的操作.

After a review of the iPhone SDK documentation, I have not yet found a way for an application to be written such that it can programmatically process the content of an incoming SMS message within the iPhone platform. The idea would be for such an application to be running in the background and based on specifically formatted SMS messages would be able to take specific actions.

有人知道iPhone SDK应用程序是否可以实现此功能吗?如果提供,则提供有关如何完成此操作的信息的指针?

Does anybody know if this is possible with an iPhone SDK application and if so, provide a pointer to information about how this can be done?

推荐答案

不幸的是,您无法使用iPhone SDK截获传入的SMS消息,也无法收到通知.

Unfortunately, you cannot intercept - or be notified of - incoming SMS messages with the iPhone SDK.

一种可能的选择是注册一个自定义URL方案,当带有该方案的URL嵌入到sms消息中并且用户点击该URL时,启动该应用程序.

One possible alternative, is to register a custom URL scheme that launches your application when a url with that scheme is embedded in the sms message and the user cicks on it.

要设置自定义网址方案,必须在应用程序的info.plist中同时实现CFBundleURLSchemes和CFBundleURLName键.

to set a custom url scheme, you must implement both the CFBundleURLSchemes and CFBundleURLName keys in your application's info.plist.

然后,在您的应用程序的委托中,您可以实现application:handleOpenURL:方法,以获取从SMS消息中的URL传递到您的应用程序的所有参数.

In your Application's delegate, you can then implement the application:handleOpenURL: method to get any paramaters that were passed to your App from the url in the SMS message.

更多推荐

iPhone:如何以编程方式响应短信

本文发布于:2023-11-27 20:12:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639441.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:短信   方式   iPhone

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!