Zac*_*117 1 background ios swift
我想从我的应用程序中打开邮件,并在文本字段中填充“共享我的应用程序...”(底部的消息字段,而不是电话号码字段)
我可以使用以下代码从我的应用程序打开消息:
UIApplication.shared.open(URL(string: "sms:")!, options: [:], completionHandler: nil)
Run Code Online (Sandbox Code Playgroud)
但是我不知道该如何传递信息。可以代替使用MFMessageComposeViewController()来做到这一点吗?我无法将其用于我遇到的背景播放问题,谢谢。
与@Kuldeep的回复非常相似
let sms: String = "sms:+1234567890&body=Hello Abc How are You I am ios developer."
let strURL: String = sms.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
UIApplication.shared.open(URL.init(string: strURL)!, options: [:], completionHandler: nil)
Run Code Online (Sandbox Code Playgroud)
似乎为我做了招,非常感谢库尔迪普(Kuldeep)在到目前为止的帮助中; )
| 归档时间: |
|
| 查看次数: |
3010 次 |
| 最近记录: |