UIActivityViewController在gmail和yahoo邮件中显示主题中的正文文本,不显示主题swift

时间:2017-11-02 05:28:23

标签: ios swift uiactivityviewcontroller

func mail_Compose(tag:Int)
{
    let dict = arrFilter?[tag] as? [String: AnyObject]
    let jobTitle = dict?["job_title"] as? String
    let cmpName = dict?["emo_company_name"] as? String
    let customUrl = dict?["custom_url"] as? String
  //  var url = ""
    let title = "Job opening for " + jobTitle!
    let content = "Job opening for \(jobTitle!) at \(cmpName!)\n"

    //Handle nil value
    guard let name = customUrl else {
        alert(message: "Url not found")
        return
    }

    let objectsToShare:Any?

    if let myWebsite = URL(string:  webServiceMailUrl + name) {
        objectsToShare = [content,myWebsite] as [Any]
    } else {
        objectsToShare = [content] as [Any]
    }

    let activityVC = UIActivityViewController(activityItems: objectsToShare as! [Any], applicationActivities: nil)
    activityVC.setValue(title, forKey: "Subject")
    if UI_USER_INTERFACE_IDIOM() == .pad {
        activityVC.popoverPresentationController?.sourceView = view
        activityVC.popoverPresentationController?.sourceRect = CGRect(x: CGFloat(view.bounds.size.width / 2), y: CGFloat(view.bounds.size.height / 4), width: CGFloat(0), height: CGFloat(0))
    }
    activityVC.excludedActivityTypes = [.print, .postToWeibo, .copyToPasteboard, .addToReadingList, .postToVimeo]

    present(activityVC, animated: true, completion: nil)
}
  • 在邮件客户端工作正常,但没有使用gmail和yahoo邮件。
  • Gmail
  • Yahoo
  • Mail client - 需要像google和yahoo这样的格式。
  • 我尝试了很多方法,但没有得到任何解决方案。有人帮助解决了这个问题。
  • 请找到上面的链接gmail,yahoo和mail client。

0 个答案:

没有答案