Hi Appwrite team,
I’m integrating the Appwrite Swift SDK into a macOS app and am hitting an environment/runtime issue when starting OAuth.
App architecture • macOS app built on AppKit lifecycle (@main class AppDelegate: NSApplicationDelegate). • Main UI windows are NSWindow instances that embed SwiftUI content via NSHostingView. • The sign-in sheet is a SwiftUI view (AuthSheetView) shown inside that hosted window.
At runtime the call logs:
Accessing Environment<OpenURLAction>'s value outside of being installed on a View. This will always read the default value and will not update.
Questions
- Does createOAuth2Session internally rely on SwiftUI’s openURL environment, and does that fail when the view is hosted inside an NSHostingView under an AppKit lifecycle?
- What’s the recommended way to trigger createOAuth2Session in a hybrid AppKit + SwiftUI macOS app? • Should we supply a custom OpenURLAction or call an alternative API that works without openURL? • Is there a configuration flag or parameter to force the SDK to use NSWorkspace.shared.open / ASWebAuthenticationSession on macOS instead of SwiftUI’s environment?
Thanks for any guidance or workarounds. Happy to provide more code or logs if needed.
Recommended threads
- I am currently seeking opportunities as ...
Hey! 👋 I'm a Shopify guy. Been building stores for 8+ years. Still haven't lost my mind. Barely. I make stores that don't suck fast, smooth, and actually built...
- Apple OAuth2 "Registration Not Complete"...
I'm getting a "Registration Not Complete" error when implementing Apple Sign In OAuth2 on self-hosted Appwrite. Environment: Self-hosted Appwrite (latest), iOS...
- Cannot use Apple Oauth2 in React Native/...
Hi! I've trying to add the Apple sign in feature into my Expo App. I followed the docs, but I still receiving the error "Cannot set 'location.href'". Can someon...