如何为iOS开发短信客户端? [英] How to develop a SMS client for iOS?

查看:142
本文介绍了如何为iOS开发短信客户端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我原来的标题是如何自定义TTMessageController进行短信传输?。我现在改变了这个,因为我寻找任何可能的解决方案,而不仅仅是 TTMessageController

my original title was How to customize TTMessageController for SMS transmission?. I changed this now because I look for any possible solution and not only those with TTMessageController.

好吧,我正在xcode4中开发一个简单的应用程序。用户应该能够从不同的SMS网关发送短信

Well, I am working on an simple application in xcode4. The user should be able to send SMS from different SMS gateways.

后台逻辑非常简单,因为所有内容都是通过执行一些http请求来管理的休息api。

The background logic is quite simple because everything is managed by executing some http requests on an rest api.

现在我的困难是设置用户界面,这是我需要帮助的地方因为我是新手iOS开发。这就是我想要的方式:

The hard thing for me now is to setup the UI and that is where I need help because I am new to iOS development. This is how I want it to be:

http://img222.imageshack.us/img222/3159/bhrfe.png

应该有一个收件人选择器要么对联系人进行自动搜索,要么直接从联系人列表中选择联系人。我想要只有一个收件人。并且应该有一个文本区域。

There should be a recipient picker to either do autosearch on contacts or to directly pick a contact from the contact list. Beside I want only one recipient. And there should be a text area.

我还希望在底部的某处有一个标签来显示当前的字符编号。

I also want to have a label somewhere at the bottom to show the current char number.

由于我没有在xcode4库中找到那些UI元素,我搜索了类似的东西,然后我找到了 TTMessageController ,它给出了你在图片中看到的视图。

Since I did not find those UI elements in xcode4 library I searched for something similar and I found the TTMessageController which gives me the view you see in the picture.

然而加按钮不起作用我我不确定如何扩展所有这些以做我想做的事。

However plus button does not work and I am not sure how to extend all this to do what I want.

我对此表示赞赏。

推荐答案

对于+按钮,您可以使用地址簿UI:

For the + Button you can use the address book UI:

// This Code is taken from Apple's sample code QuickContacts
#import <AddressBookUI/AddressBookUI.h>

-(void)showPeoplePickerController {
    ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
    picker.peoplePickerDelegate = self;
    // Display only a person's phone, email, and birthdate
    NSArray *displayedItems = [NSArray arrayWithObject:[NSNumber numberWithInt:kABPersonPhoneProperty]];


    picker.displayedProperties = displayedItems;
    // Show the picker 
    [self presentModalViewController:picker animated:YES];
    [picker release];   
}

< ABPeoplePickerNavigationControllerDelegate> 委托包括这种方法:

– peoplePickerNavigationController:shouldContinueAfterSelectingPerson:
– peoplePickerNavigationController:shouldContinueAfterSelectingPerson:property:identifier:
– peoplePickerNavigationControllerDidCancel:

选择一个人后,你可以将他/她的号码保存在一个数组中在文本字段中(例如以逗号分隔)

After selecting a person you can save his/her number in an array and in the text field (e.g. comma separated)

关于这里是否批准的问题是指南:

https://developer.apple.com /appstore/resources/approval/guidelines.html

For the question if it will be approved here is the guideline:
https://developer.apple.com/appstore/resources/approval/guidelines.html


22.6支持匿名或恶作剧电话或短信/彩信的应用将被拒绝

22.6 Apps that enable anonymous or prank phone calls or SMS/MMS messaging will be rejected

这篇关于如何为iOS开发短信客户端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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