D
D
Dmitry2015-11-18 11:49:28
iOS
Dmitry, 2015-11-18 11:49:28

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);
  }

The native iOS mail app appears in the list and accepts text, file, and even the subject line.
But Yandex.Mail does not appear in the list of available applications for some reason ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
An, 2015-11-18
@Flanker_4

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 question

Ask a Question

731 491 924 answers to any question