当前位置:网站首页>IPhone sending SMS implementation
IPhone sending SMS implementation
2022-06-24 02:29:00 【User 7108768】
We know that we can use such code in iphone Send text messages in :
[[UIApplication sharedApplication] openURL:@"sms:12345678"];
But this method can not specify the content of SMS . Then we can use MessageUI frame .
First import in the program MessageUI.framework.import The header file :#import "DeviceDetection.h"
Then use the following statement in the code to call the SMS sending window , And specify the number and SMS content :
MFMessageComposeViewController *controller = [[[MFMessageComposeViewController alloc] init] autorelease]; controller.body = @"zc"; controller.recipients = [NSArray arrayWithObjects:@"106295598", nil]; controller.messageComposeDelegate = self; [self presentModalViewController:controller animated:YES];
At the same time, the protocol MFMessageComposeViewControllerDelegate, In the protocol method messageComposeViewController:didFinishWithResult:
switch (result) {
case MessageComposeResultCancelled:
NSLog(@"Cancelled");
break;
case MessageComposeResultFailed:
[self alert:@" Error sending SMS !"];
break;
case MessageComposeResultSent:
break;
default:
break;
}
[self dismissModalViewControllerAnimated:YES];边栏推荐
- Some tips for using uitextview
- Grpc: adjust data transfer size limit
- [Tencent cloud double 12.12] from 56 yuan! New users of Tencent cloud buy for the first time, which is more cost-effective!
- How to query the cloud desktop server address? What are the advantages of using cloud desktop?
- The whole procurement process of the procurement mall website in the transportation industry is electronic to reduce the procurement cost
- UNIX command encyclopedia, common commands are here, work must!
- Set multiple print for batch generated barcodes
- What is the domain name trademark? What are the registration conditions for domain names and trademarks?
- Operation and maintenance platform tcapulusdb transaction management
- A variety of fixed assets inventory methods to deal with the year-end large inventory of fixed assets
猜你喜欢

BIM model example

If there are enumerations in the entity object, the conversion of enumerations can be carried out with @jsonvalue and @enumvalue annotations

How to fill in and register e-mail, and open mass mailing software for free

163 mailbox login portal display, enterprise mailbox computer version login portal

Advanced BOM tool intelligent packaging function

Introduction to development model + test model
Cloudpods golang practice

2020 language and intelligent technology competition was launched, and Baidu provided the largest Chinese data set

Leetcode969: pancake sorting (medium, dynamic programming)

application. Yaml configuring multiple running environments
随机推荐
SQL Server database recovery case analysis
How to use annotations to record operation logs gracefully
What is a private VLAN? Eight part essay with pictures and texts.
S2b2c platform of fresh food industry reshapes the ecosystem of agricultural products and builds a mobile fresh food comprehensive mall
How to quickly handle third-party login and easy to expand?
Cloud game cannot select a server cloud game server fees
If you accidentally make the disk dynamic, how to convert it back (do not guarantee it, but take a snapshot before operation)
What is ITF barcode
Official spoilers! Figure 1 understand Tencent security @2021 Tencent digital ecology Conference
Grpc: adjust data transfer size limit
Start tcapulusdb process
Case of data recovery by misoperation under NTFS file system
Introduction to development model + test model
How to build video websites? What are the types of video websites?
Compile blender source code
Is it illegal to use someone else's trademark to register a domain name? What should we pay attention to when registering a domain name?
Efficient Internet access and systematic learning
Fulleventlogview does not display some event ID contents
Tornado code for file download
How to set up a cloud desktop server? What are the advantages of cloud desktop?