I am trying to get my application to send its current GPS location via SMS to a pre-allocated phone number.
I have my code right now, which only calls the SMS window inside the application, in which I can edit in the receiving number and body. I am wondering how to get the current location in this body so that it can be sent via SMS? I can not understand.
Here's what my code looks like right now regarding the SMS feature.
-(IBAction) sendInAppSMS:(id) sender { MFMessageComposeViewController *controller = [[[MFMessageComposeViewController alloc] init] autorelease]; if([MFMessageComposeViewController canSendText]) { controller.body = @"Alarm!, call the senders number!"; controller.recipients = [NSArray arrayWithObjects:@"phonenumber1", @"phonenumber2", nil]; [self presentModalViewController:controller animated:YES]; } }
source share