UIActivityViewController主题不适用于Outlook [英] UIActivityViewController Subject not working for Outlook

查看:74
本文介绍了UIActivityViewController主题不适用于Outlook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

敌人设置共享主题,优先级

Foe setting subject of share, overriding

   func activityViewController(activityViewController: UIActivityViewController, subjectForActivityType activityType: String?) -> String {
          return "mySubject"
    }

共享时不适用于Outlook应用程序.不会为Outlook调用此方法,它适用于其他应用程序,例如邮件,gmail等.

not working for outlook app, while sharing. this method not being called for outlook, works for other apps like mail, gmail etc.

发现某些应用程序(例如Yelp,Apple Maps和Google Maps)可以在Outlook中设置主题.如何实现呢?

Found that some app like Yelp, Apple maps, Google Maps able to set subject in outlook. How'd one achieve it?

推荐答案

我相信我已经弄清楚了如何在这些应用程序中使用它.我在自己的应用程序中观察到了相同的行为,即在选择Outlook应用程序时未调用func activityViewController(_ activityViewController: UIActivityViewController, subjectForActivityType activityType: UIActivityType?) -> String的情况.但是,我以CNN应用程序为例,它正确地创建了主题行.

I believe I figured out how this was made to work in those apps. I observed the same behavior in my own app where func activityViewController(_ activityViewController: UIActivityViewController, subjectForActivityType activityType: UIActivityType?) -> String is not being called when choosing the Outlook app. However, I noted the CNN app, as an example, was properly creating a subject line.

答案似乎是使正文的第一行成为您希望的主题.我有一个要附加URL的资产,因此主题正在插入不需要的URL.但是,当我设置了我想要的主题时,即电子邮件正文的第一行,它确实在Outlook中正确填充了电子邮件的主题.

The answer it seems is to make the first line of the body text be what you wish the subject to be. I had an asset I was attaching with a URL and so the subject was inserting the URL which I didn't want. However, when I made the subject I did want, the first line of the body in the email, it did then populate the email's subject in Outlook correctly.

所以这不是理想的选择,当然应该调用适当的协议功能,但这似乎是其他人绕过了我们原本无法为Apple或Microsoft解决的问题的方式.

So this isn't ideal and certainly the appropriate protocol function should be called, but this does appear to be how others have gotten around what we otherwise cannot fix for Apple or Microsoft.

这篇关于UIActivityViewController主题不适用于Outlook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆