Running this function using SwiftyDropbox! Was working well til this morning, now it returns nothing useful, just the reply that the link already exists, and when I try and get the link... it returns nil.
Did see a post saying this functionality is broken right now. I hope not the case cause it is a single point of failure in my project!
Without shared links I am dead in the water.
func sharing_create_linkV2(sourcePath: String, posIndex: Int, group2join: DispatchGroup) {
print("sharing_create_linkV2 \(sourcePath)")
let client = DropboxClientsManager.authorizedClient!
_ = client.sharing.createSharedLinkWithSettings(path: sourcePath).response(queue: DispatchQueue(label: "MyCustomSerialQueue")) { response, error in
//_ = client.files.listFolder(path:sourcePath).response(queue: DispatchQueue(label: "MyCustomSerialQueue")) { response, error in
if let response = response {
group2join.leave()
//print(Thread.current) // Output: <NSThread: 0x61000007bec0>{number = 4, name = (null)}
//print(Thread.main) // Output: <NSThread: 0x608000070100>{number = 1, name = (null)}
print("\(response.url) \(posIndex)")
sharedDataAccess.fnLink(index2seek: posIndex, fnLink: response.url)
sharedDataAccess.fnPos(index2seek: posIndex, fnPos: posIndex)
} else {
print("error \(error)")
// error [request-id 4da78c6dd1e2c15fad08659eca204725] API route error - {
//".tag" = "shared_link_already_exists";
_ = client.sharing.getSharedLinkFile(url: sourcePath).response(queue: DispatchQueue(label: "MyCustomSerialQueue")) { response, error in
group2join.leave()
print("fcuk1510 data \(sourcePath) \(response?.0) \(response?.1 ) \(posIndex)")
sharedDataAccess.fnLink(index2seek: posIndex, fnLink: response?.0)
sharedDataAccess.fnPos(index2seek: posIndex, fnPos: posIndex)
}
}
}
}