当前位置:网站首页>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];边栏推荐
- Cloud game cannot select a server cloud game server fees
- 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?
- WordPress site quickly integrates Tencent's digital identity management and control platform CIAM to realize login authentication without development
- Code 128 barcode details
- Cloud rendering: cloud exhibition hall of Tencent digital ecology Conference - open roaming mode on cloud
- Grpc: adjust data transfer size limit
- Is the trademark registered domain name legal? How do trademarks register domain names?
- [supply chain • case] Tianneng group: the key to understanding the leading battery manufacturer to achieve the first profit fault
- Leetcode838: push domino (medium)
- How to obtain the information of easydss single / multiple live streams through the API interface?
猜你喜欢

application. Yaml configuring multiple running environments

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

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

BIM model example
Cloudpods golang practice

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

Advanced BOM tool intelligent packaging function

Introduction to development model + test model

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

Leetcode969: pancake sorting (medium, dynamic programming)
随机推荐
How to build a video website? How much does it cost to build a video website?
Vivo global mall: design and practice of commodity system architecture
Wwise + GME game voice scheme: unlock more voice playing methods and let players "sound in their environment"
163 mailbox login portal display, enterprise mailbox computer version login portal
The easydss on demand file upload interface calls postman to report an error. Failed to upload the file?
Cloud game cannot select a server cloud game server fees
A detailed explanation of the laser slam framework logo-loam
Set multiple print for batch generated barcodes
Contour-v1.19.1 release
What is raid? 2000 words can explain RAID 0, 1, 5 and 10 thoroughly, and collect!
The difference between classless routing and classless routing
application. Yaml configuring multiple running environments
What is a region name? Can a territory name be used for trademark registration?
What information should be provided for enterprise trademark registration? Is it difficult to register a trademark?
What are the main functions of DNS? What are the benefits of IP address translation
How to design and make ppt gradient effect?
What is a private VLAN? Eight part essay with pictures and texts.
Cloud recommendation Vol.1: quick start to remote control under f-stack, go modules and 5g!
Tencent cloud won the first place in the cloud natural language understanding classification task
Gin framework: add API logging Middleware