mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Fixed #1683 (sharing fails but then succeeds)
This commit is contained in:
parent
860c17cfba
commit
b713b5e917
1 changed files with 6 additions and 2 deletions
|
@ -253,13 +253,15 @@ private extension ShareViewController {
|
|||
request.httpMethod = "POST"
|
||||
request.httpBody = postBody.data(using: .utf8)
|
||||
|
||||
let config = URLSessionConfiguration.background(withIdentifier: "group.com.newsblur.share")
|
||||
let config = URLSessionConfiguration.background(withIdentifier: UUID().uuidString)
|
||||
config.sharedContainerIdentifier = "group.com.newsblur.NewsBlur-Group"
|
||||
|
||||
let session = URLSession(configuration: config, delegate: self, delegateQueue: nil)
|
||||
let task = session.dataTask(with: request as URLRequest)
|
||||
|
||||
task.resume()
|
||||
|
||||
NSLog("⚾️ sending: \(request) \(postBody) \(config.identifier ?? "")")
|
||||
}
|
||||
|
||||
var requestPath: String {
|
||||
|
@ -365,6 +367,8 @@ extension ShareViewController: URLSessionTaskDelegate {
|
|||
if let error = error {
|
||||
print("task completed with error: \(error)")
|
||||
|
||||
NSLog("⚾️ share error: \(error)")
|
||||
|
||||
switch mode {
|
||||
case .save:
|
||||
content.body = "Unable to save this story"
|
||||
|
@ -376,7 +380,7 @@ extension ShareViewController: URLSessionTaskDelegate {
|
|||
} else {
|
||||
print("task completed successfully: \(String(describing: task.response))")
|
||||
|
||||
NSLog("⚾️ share: \(String(describing: task.response))")
|
||||
NSLog("⚾️ share success: \(String(describing: task.response))")
|
||||
|
||||
switch mode {
|
||||
case .save:
|
||||
|
|
Loading…
Add table
Reference in a new issue