繁体   English   中英

如何在 Apple Watch 上以编程方式编写 email?

[英]How can I programmatically compose an email on Apple Watch?

如何打开 email 应用程序到撰写屏幕,消息正文预加载特定文本?

这是一个在苹果手表上编写短信的例子,它完全可以工作,但我需要在我的手表应用程序上编写一个 email。

let messageBody = "Hello World!"

let urlSafeBody = messageBody.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLHostAllowedCharacterSet())

if let urlSafeBody = urlSafeBody, url = NSURL(string: "sms:&body=\(urlSafeBody)") {
    WKExtension.sharedExtension().openSystemURL(url)
}

我不相信有任何方法可以做到这一点,我很害怕。 在 iOS 上,您将使用MFMailComposeViewController ,但在 WatchOS 上没有等效项。

我过去所做的是向配套的 iPhone 应用程序发送一条消息,然后该应用程序代表手表应用程序生成 email。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM