microsoft-authentication-library-for-objc icon indicating copy to clipboard operation
microsoft-authentication-library-for-objc copied to clipboard

Swift 6 - Concurrency issue (Main Thread)

Open Smponias opened this issue 1 year ago • 3 comments

So as we know try await applicationContext.acquireToken(with: parameters)needs to be called from the Main Thread because it is doing some UI Stuff.

Bildschirmfoto 2024-09-26 um 20 57 15

But when I try to do it on MainActor I get: Non-sendable type 'MSALResult' returned by implicitly asynchronous call to nonisolated function cannot cross actor boundary

Do you plan to make MSALResult sendable or how should we do it?

Smponias avatar Sep 26 '24 19:09 Smponias

Have you tried using @preconcurrency ? .

Veena11 avatar Sep 28 '24 00:09 Veena11

No I am using withCheckedContinuation and I am switching to the main thread myself. But I can't use the async await function.

@preconcurrency I didn't use @Veena11 :)

Smponias avatar Sep 29 '24 15:09 Smponias

@Smponias , Could you share the code snippet where you make the call to acquireToken API, so we can get a clear picture of what you are doing ?

Veena11 avatar Oct 01 '24 18:10 Veena11

Closing as there is no response from reporter

Veena11 avatar Feb 04 '25 19:02 Veena11