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
Related
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)
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];
For Share sheet for my iOS app. As I referred in this link How to display the default iOS 6 share action sheet with available share options?.
And I end up with below working code :
NSString *string = #"Some text to share";
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:#[string]
applicationActivities:nil];
[self presentViewController:activityViewController
animated:YES
completion:^{
NSLog(#"complerted.");
}];
But I can see only Email & Message button !!?
How can I get other social media buttons in Share sheet like Facebook , twitter as seen below. Even though user account not available/created in device? (As we can see iOS default Photos app, where the share sheet has social buttons even though for example facebook not installed in the device!) Should I enable or extend extension?
Please help,
Thanks & Regards,
//Update
- I added iOS-8 social framework and imported #import <Social/Social.h>.
This UIactivityController show the app which can share your string or image. If you have not added any Facebook or twitter account than that will not show that app in this action sheet.
Try by adding Facebook and twitter account in your devices setting. you will able to see that app too.
You have a More button in your share sheet. Tap on it & it will shows all the available Extension & turn on it for Facebook & Twitter.
I'm using UIActivityViewController, I want to show Facebook option even if the user has not defined a Facebook account in device settings.
In my code, Facebook option not shown when there is no Facebook acoount in settings.
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:itemsToShare applicationActivities:nil];
[self presentViewController:activityVC animated:YES completion:nil];
But, in Safari or more apps there is Facebook option and when click on it - a alert is displayed with "No facebbok account" title and message says "go to settings".
There is any way to add Facebook like this or this possible just for apple apps?
There's no way to do that using UIActivityViewController. If you check other apps (no apple development) you can see that doesn't use UIActivityViewController but Action Sheets or something else and uses Social Framework. You can check this answer. And check this tutorial if you use Social Framework.
Hope it helps!
I'm pretty desperate by now -- I can easily upload images to Twitter, Facebook, E-Mail, SMS etc. using very simple APIs.
However, I can't find any information what APIs to use for Flickr uploads.
There's a bunch of libraries that do it, but I thought it was "deeply integrated" into iOS 7 and all I'd need would... basically... be... a... "FRComposeViewController"? ;-)
You need to share your items using the UIActivityViewController to take advantage of flickr sharing.
UIActivityViewController * controller = [[UIActivityViewController alloc] initWithActivityItems:#[image, message] applicationActivities:nil];
[self presentViewController:controller
animated:YES
completion:^{
}];
Is all you need to do, where image is your UIImage instance and message can be an optional NSString instance.
The flickr sharing is a bit buried all the way over on the left...
UIActivity's UIActivityTypePostToFlickr object "posts the provided image to the user’s Flickr account".
Is this what you're looking for?