ios7 - Is there a way to send a link via sms or other application in iOS? -
i have button on each cell of table. when button pressed want sms screen open , have prepopulate unique link.
i've done in android using android.intent.action.send
i'm not sure how in ios. in android when user clicks button, android automatically gives user several options share url (facebook/twitter/sms/gmail/etc). prefer happen, if isn't possible opening sms screen sufficient.
i imagine possible in ios?
i'd recommend using uiactivityviewcontroller should show of apps on device capable of sending link. work setting contents of message though; unfortunately, doesn't seem it's possible set recipient using technique.
nsstring *text = @"click on link!!"; nsurl *url = [nsurl urlwithstring:@"http://google.com"]; nsarray *itemstoshare = @[text, url]; uiactivity *activity = [[uiactivity alloc] init]; nsarray *applicationactivities = [[nsarray alloc] initwithobjects:activity, nil]; uiactivityviewcontroller *activityvc = [[uiactivityviewcontroller alloc] initwithactivityitems:itemstoshare applicationactivities:applicationactivities]; [self presentviewcontroller:activityvc animated:yes completion:nil];
if know want send sms (rather letting user decide) there few other options.
mfmessagecomposeviewcontroller
the following web page job of explaining how this: http://www.appcoda.com/ios-programming-send-sms-text-message
open sms: url
it's possible show sms composer using simple "sms:" link can pre-populate recipient's phone number, not message, won't enough need. example:
[[uiapplication sharedapplication] openurl:[nsurl urlwithstring:@"sms:1-408-555-1212"]];
Comments
Post a Comment