I would like to let users browse photos in their photo albums, tap the action button, and share/open selected photos in my app. Some apps (like Viber and WeChat) provide a custom view to handle this. This is the WeChat screen:
What is the name of this feature and which class do I have to use to achieve this behavior?
You need to do check for share option in the ioS extensions
app extensions
extension programming guide
EDIT:
Removed 3 & 4 links, which are not working. thanks to Daniel.
Share extension can be found inside the Extension programming guide(2nd link > App Extension Types > Share)
You can use UIImagePickerController for the purpose. Find Class reference here Here is a Sample code
Related
I see that app like twitter has the feature to automatically hide the share extension depending on number of items selected, .ie in Photo app like:
Anybody has any idea on how to obtain something like twitter share extension
Thanks
This can be achieved by setting NSExtensionActivationSupportsImageWithMaxCount in info.plist
Use: Declaring Supported Data Types for a Share or Action Extension
https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html#//apple_ref/doc/uid/TP40014214-CH21-SW8
https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/AppExtensionKeys.html
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.
I want to show my app when user try to share Image from Photo gallery. How can i show my app in that list?
I tried with public.image as content type but not working for me.
Thanks,
You have to create a share extension for your application. For detailed info you can check the official apple documentation for extensions https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/index.html
You can use UIActivityViewController to share the images and data.
If you want to see tutorial please refer following link.
UIActivityViewController
I'm trying to show apps from UIDocumentInteractionControllerDelegate , default apple apps like; sms, email or UIPasteBoard (Facebook and Twitter is optional) . Just like the similar of Dropbox app :
How can I handle this kind of situation? I've done already open apps from their UTI's, open just email or just sms but I don't how to show all of them in one sheet.
Thanx
I believe you're looking at an UIActivityController instead of a UIDocumentInteractionController, which I believe Apple is trying to phase out.
Check out the docs here https://developer.apple.com/library/ios/documentation/uikit/reference/UIActivityViewController_Class/Reference/Reference.html
You should try QLPreviewController. This will give you desired result.
https://developer.apple.com/library/ios/Documentation/NetworkingInternet/Reference/QLPreviewController_Class/Reference/Reference.html
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.