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]; 

enter image description here


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"]]; 

https://developer.apple.com/library/ios/featuredarticles/iphoneurlscheme_reference/smslinks/smslinks.html


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -