I am trying to add voip call functionality to my app.
It works as expected while the app is in the foreground. But in the background it does not.
I have registered the app as requiring background voip permissions.
My implementation doesn't fit into one of these posts, so here is a gist:
https://gist.github.com/BrentMifsud/4be43c022c1279f04ecb56250a86b3f1
Post
Replies
Boosts
Views
Activity
So our back end manages tokens in a strange way.
Whenever we try to request a new access token using our refresh token, it invalidates our old refresh token and returns us with a new access + refresh token.
The problem with this is that multiple concurrent network requests can see that a user's access token has expired and try to get a new access token, potentially causing us to get a 401 unauthorized error.
Is there any way with structured/unstructured concurrency to ensure that our method for grabbing the access token can only at max be run once at a time?
Im assuming the only realistic way would be to do something like this:
@MyGlobalActor private var tokenTask: Task<String, any Error>?
@MyGlobalActor func getAccessToken() async await -> String {
if let tokenTask {
return try await tokenTask.value
}
self.tokenTask = Task<String, any Error> {
// refresh access token
}
let token = try await self.tokenTask!.value
self.tokenTask = nil
return token
}
Happens everywhere I try:
In the Apple developer portal, downloading results in a 403 error:
https://download.developer.apple.com/Developer_Tools/Xcode_15.1/Xcode_15.1.xip
In the Mac app store, Xcode is gone. If I deep link to it via safari, I see the following error: