can't share hyperlink to whatsapp using UIActivityViewController - ios

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)

Related

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.

Pop WeChat/Weixin Safari-like Share Sheet in my app UIActivityViewController?

I'm trying to pop the built in Safari share WeChat in my iOS app. But can't find a way to make WeChat app show up in the UIActivityViewController!
I noticed that the WeChat app icon shows up when sharing images from the Photo Gallery, and Safari link sharing. The native Notes app doesn't have WeChat option.
Not sure how that's working, any help is appreciated! Thanks!
This is done using "Share" extensions. See Apple docs for more information: https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/ExtensibilityPG/ShareSheet.html#//apple_ref/doc/uid/TP40014214-CH12-SW1
Regarding why some apps appear in certain sharing contexts but not in others, this is because a Share extension has to declare to iOS which kind of data it supports for sharing. Presumably, WeChat developers did not enable their Share extension for "pure" text content, like in the Notes app. See here for how to set which kind of data a Share extension accepts: https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html#//apple_ref/doc/uid/TP40014214-CH21-SW8
Unfortunately you won't be able to add the WeChat Share extension on behalf of them if they didn't allow it, but you might be able to use some WeChat API to develop your own app extension with text content enabled.
Hope it helped.
WeChat's icon won't appear in UIActivityViewController if you try to share anything other than URL. WeChat only accepts URL posts. This code snippet should work for you:
NSArray *items = #[[NSURL URLWithString:#"http://google.com"]];
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil];

How to open album list like photos native application?

As i saw this in "Viber" application. There is media sharing button which opens all the albums as shown in photos native application. Can we do this ? I found UIImagePickerController cannot shows both simultaneously. How show both photo gallery and video gallery simultaneously ?
You're right about UIImagePickerController here great guide, and github project for picking media.
If you want to share your media here's some cool examples:
Check this tutorial on how to share pictures via email.
If you want to share via mail -
First of all you have to Create NSData object from your PNG/JPEG image data and then implement the method: Send addAttachmentData:mimeType:filename: to your MFMailComposeViewController instance.
Also i think the best thing to use in your case to share stuff like text, pictures etc is Sharekit.

UIActivityViewController Flickr Sharing - No Flickr option appears

I am trying to use the UIActivityViewController Flickr sharing in iOS 7 but the Flickr icon does not appear in the sharing sheet. I feel like I am missing something basic.
I am testing on an iPhone 5S.
I am logged into a Flickr account on the device.
The same share sheet displays and shares properly with Facebook, Twitter, Email , MMS, and AirDrop.
The photos app on the device displays the Flickr icon in the photos app sharing sheet and can share successfully to the phone Flickr account.
I am sure that I am not listing Flickr in the excluded activities for the UIActivityViewController.
I have tried with both standard UIActivityViewController and the RDActivityViewController subclasses.
Is there something additional required for Flickr sharing? or could someone confirm that they have seen this work in their own app.
Thanks
Flickr share with UIActivityViewController will only work if you are sharing a image.
So in your array with activity items there should be at least one image.
Make sure that the image is of type UIImage:
NSArray *shareItems = #[someImage, #"Text of the messages"];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:shareItems applicationActivities:nil];
Exmple of how it looks: https://www.dropbox.com/s/jpjmnuqbktqgb8s/FlickTest.png

Send image with Message UIActivity

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

Resources