I'm doing an app, which is an RSS reader.
What I want is that you can share a story by whatsapp, and that the data you share are:
- An image
- A title
- A link
At the moment I have this:
let urlString = "Hello Friends, Sharing some data here..."
let urlStringEncoded = urlString.stringByAddingPercentEncodingWithAllowedCharacters(.URLQueryAllowedCharacterSet())
//URLHostAllowedCharacterSet
urlToGo = NSURL(string: "whatsapp://send?text=\(urlStringEncoded!)")
print(urlToGo)
if UIApplication.sharedApplication().canOpenURL(urlToGo!){
UIApplication.sharedApplication().openURL(urlToGo!)
}else{
let alertController = UIAlertController(title: "Error", message: "No tienes instalado Whatsapp en el dispositivo", preferredStyle: .Alert)
let defaultAction = UIAlertAction(title: "OK", style: .Default, handler: nil)
alertController.addAction(defaultAction)
presentViewController(alertController, animated: true, completion: nil)
}
How can I add a link, a text and an image?
There is a library with which you can do it
Thanks !!!!