Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Kalle Kod
37 PointsSms and Calls from app. Who pays?
Is it developer who pays or the user?
4 Answers
Cian Mac Mahon
17,657 PointsSo long as you are not doing anything special (routing calls/sms through your own server or something) it will be the user that pays for the SMSs and phonecalls. It's similar to the idea of a mailto: link in HTML - it's simply telling the phone to perform an action.
Kalle Kod
37 PointsI see!! Thank you!
I don't think so :) Could you tell by looking at the code?
This is the code for call:
-
(IBAction)makeCall:(id)sender {
NSString *phoneNumber = self.phonecall; // dynamically assigned NSString *phoneURLString = [NSString stringWithFormat:@"tel:%@", phoneNumber]; NSURL *phoneURL = [NSURL URLWithString:phoneURLString]; [[UIApplication sharedApplication] openURL:phoneURL];
if ([UIApplication instancesRespondToSelector:@selector(canOpenURL:)]) { NSURL *aURL = [NSURL URLWithString:@"tel:"]; if ([[UIApplication sharedApplication] canOpenURL:aURL]) { [[UIApplication sharedApplication] openURL:aURL]; } }
}
This is the code for sms:
- (IBAction)sendSMS:(id)sender { MFMessageComposeViewController *controller = [[[MFMessageComposeViewController alloc] init] autorelease];
if([MFMessageComposeViewController canSendText]) { NSString *str= @""; controller.body = str; controller.recipients = [NSArray arrayWithObjects: @"", nil]; controller.delegate = self; [self presentViewController:controller animated:YES completion:nil]; }
}
Patrick Cooney
12,216 PointsAny calls or texts originating directly from the operating system are going to be charged to the user. The only way you as a developer would pay is if you were using an API (like Twilio) to make calls and send messages.
Kalle Kod
37 Pointsahhh thanks!!!! :))))))))))