waarlockk
waarlockk

Reputation: 21

launching SMS app when app starts

I need to open the pre installed SMS app in iPhone. I know how to open SMS app using MFMessageUI class, but the problem is that it can be used to display it as a modal view which in turns requires a view controller.

Does anybody know how to populate it in AppDelegate didFinishLaunchingWithOptions?

Upvotes: 0

Views: 289

Answers (2)

Andrea Mario Lufino
Andrea Mario Lufino

Reputation: 7921

NSString *stringURL = @"sms:+12345678901";
NSURL *url = [NSURL URLWithString:stringURL];
[[UIApplication sharedApplication] openURL:url];

This :)

Upvotes: -1

beryllium
beryllium

Reputation: 29767

Try this code

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:1234567890"]];

Upvotes: 2

Related Questions