1

我已经想出了如何使用下面的代码打开一个 x-callback-url,但我正在努力弄清楚如何读取发回的内容。任何想法表示赞赏:

 let BearURL = "bear://x-callback-url/add-text?title=notenane&text=somestuff&mode=append"

 if let checkURL = NSURL(string:  BearURL ) {
     if NSWorkspace.shared.open(checkURL as URL) {
         print("URL Successfully Opened for: \(BearURL)")
     }
 } else {
     print("Invalid URL: \(BearURL)")
 }
4

0 回答 0