Answer the question
In order to leave comments, you need to log in
UIActivityViewController doesn't fumble email+file in Yandex.Mail?
Task: send a file from the file system + text from the application to any application that can accept file + text.
There is a banal code for sharing a certain document (PDF format) and text. Written under Xamarin, but the essence is the same as in native code:
public class ShareResult:IActionResult
{
public string FilePath { get; set; }
public string Text { get; set; }
public string Subject { get; set; }
}
var controller = new UIActivityViewController(GetShareParams(actionResult).ToArray(), null);
controller.SetValueForKey(NSObject.FromObject(actionResult.Subject), new NSString("subject"));
AppDelegate.NavigationController.PresentViewController(controller, true, null);
private IEnumerable<NSObject> GetShareParams(ShareResult actionResult)
{
if (!actionResult.Text.IsEmpty())
yield return new NSString(actionResult.Text);
if (!actionResult.FilePath.IsEmpty())
yield return new NSUrl(actionResult.FilePath, false);
}
Answer the question
In order to leave comments, you need to log in
I don’t use Yandex mail on iOS and I don’t understand the specifics of its work, but I’ll try to ask leading questions, maybe they will help you
1) Are you sure that this client has the appropriate extension (the best way to check is to try to share the text with Safari)
2) If the answer to the previous question is "yes", then try to remove the url from the sharing. Maybe Yandex client does not support link sharing.
3) If the first question is "no, no" then try to make your custom action through the url sheme (Yandex, according to handleopenurl.com/scheme/yandex.mail is yandexmail)
Here are examples of how to do
nshipster.com/uiactivityviewcontroller
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question