Send image with Message UIActivity - ios

I'm using UIActivityViewController with some custom activities to send an image to DropBox and Instagram successfully.
Is there a way to send the same image (and text) inside n MMS message using the default UIActivity?
There's nothing in the documentation about this.
More info:
When I select Message from the UIActiviViewController pop-up only the text is sent - so something works - but not the image.

UIActivity doesn't currently allow this feature for Messages, only text is allowed.
http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIActivity_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40011974-CH1-DontLinkElementID_4
under constants UIActivityType Message, Supports NSString and Attributed String only, no UIImage

Related

can't share hyperlink to whatsapp using UIActivityViewController

I was trying to share some text with a hyperlink using UIActivityViewControllerin my app, the text is formatted using <html> script as shown.
UIActivityViewController *activityVC [[UIActivityViewController alloc] initWithActivityItems:#[#"<html><body><b>This is a bold string</b><br\\>Check out this amazing site: <a href='http://apple.com'>Apple</a></body></html>"] applicationActivities:nil];
it shows fine in many social media apps, while it is not working for whatsapp. In whatsapp it shows simply as a plain text (check image attached),
<------for gmail app
<------for whatsapp app
what is the issue here? please help me. Thanks.
May be whatsapp messenger do not support it. As mentioned on this link. https://www.whatsapp.com/faq/en/iphone/23559013
WhatsApp Messenger can handle various types of media:
images of any type that conforms to public.image (for example, PNG and JPEG)
videos of any type that conforms to public.movie (for example, MPEG-4 video)
audio files (only MPEG-3, MPEG-4, AIFF, AIFF-C and Core Audio)

Prevent sharing with UIActivityViewController to certain apps

From my iOS-App I would like to disable sharing to Apps like Tumblr or Instapaper. My instance of UIActivityViewController has the property excludedActivityTypes, but what exactly do I put into this array?
For example, when Tumblr-sharing succeeds, the activity name, taken from completionWithItemsHandler is com.tumblr.tumblr.Share-With-Tumblr. But adding this string to excludedActivityTypes doesn't remove Tumblr from the list of choices.

Share text AND media with WhatApp Share Extension

I'm using a UIActivityViewController to enable the user to share photos and videos created with my app. I attached two UIActivityItemProviders to it: one for the media and one for a default text to use ("Created with...").
This works well for all share extensions I tested—except for WhatsApp. WhatsApp only shows the text in the message dialog—no photo or video. When I leave the text blank, however, it will show the media file.
Is there any way I can share a photo or video with a default text/caption via WhatsApp?
I'm facing the same challenge. I implemented my own extension using https://github.com/sascha/SSCWhatsAppActivity. The downside is that you'll get two WhatsApp entries when sharing. WhatsApp's own one, and the custom one. I tried excluding WhatsApp's own extension using UIActivityViewController.excludedActivityTypes with the activityType net.whatsapp.WhatsApp.ShareExtension but since iOS 8.1 this is not possible anymore (on purpose or a bug). More on that here: http://johnszumski.com/blog/excluding-third-party-apps-from-ios-8-share-sheet
My conclusion, there is no way to provide both text + media to WhatApp own sharing extension. I decided to keep my custom WhatsApp sharing extension and name it "WhatsApp (+Image)" so the user can distinguish the two.

UIActivityViewControlloer don't show thumbnail for links

I am developing an iOS app that uses the UIActivityViewController to share some text and a Url. In the Facebook and Twitter services it shows a thumbnail of the site located at the URL.
Unfortunately, the site in question does not look very good at all in the thumbnail. So currently the thumbnail has a negative value in the share dialog. I would either like to prevent the thumbnail from displaying, or supply my own image for the thumbnail. What is the best method to do this?
I would like to avoid having to create my own service and/or dialog.
I have tried adding an image to the item list, however that adds a bunch of services I don't want and adds the Image to the email action and adds the image to a photo album on facebook. The first problem I can get around by blacklisting actions I don't want. And I can make my own UIActivityItemProvider to stop the email problem. However, I have no idea how to prevent the facebook problem. (See How do I customize a UIActivityViewController to show a URL link when posting to facebook and twitter?).
Here is a screenshot of the facebook sharing dialog:

Is it possible to create an MMS which contains a url link to launch a local app

I can launch my app if I embed a url in an SMS and then the user clicks on the url from within the message app. I have this all working.
What I would like to be able to do however is send an MMS to the device which contains a number of image(s) and text filling the screen and when the user clicks on the url within the MMS my app is launched same as it is if clicked from within an SMS.
Is it possible to mock this up so I can see it working? i.e. how could I create an MMS containing a working active link to demo a proof of concept (I'm not talking about creating an MMS programatically on iOS, just how to create one containing my app's url to send to the device)?
Edit: This answer was written under the assumption that implementation details were required for the URL handling part. I'll leave the technical details here for future Googlers.
Here is a link to a forum thread which seems to indicate you can't send MMSes from the iPhone programmatically (I know you said you didn't want to know this anyway, but it's here for completeness). The suggestion is to use a message provider's MMS gateway directly (e.g http://www.smsglobal.com).
Instructions on how to get a hyperlink into an MMS are here. You can just write it in plain text, or use an anchor: <a href="myapp://"> Not 100% sure the iPhone will properly parse those anchor tags in an MMS though.
Read this article. The gist is that you add a "URL types" row to your Info.plist and set it to any valid protocol, say myapp, and then a user opens a link in an MMS to a myapp URL. Article excerpt:
myapp://
myapp://some/path/here
myapp://?foo=1&bar=2
myapp://some/path/here?foo=1&bar=2
The iPhone SDK, when launching the application in response to any of the URLs above, will send a message to the UIApplicationDelegate.
If you want to provide a custom handler, simply provide an implementation for the message in your delegate. For example:
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
// Do something with the url here
}

Resources