Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

docs: add facebook auth swift example (#29587)

Guilherme Souza503415602c70
diff --git a/apps/docs/content/guides/auth/social-login/auth-facebook.mdx b/apps/docs/content/guides/auth/social-login/auth-facebook.mdx
index 12a71a089d0..420bf7511d0 100644
--- a/apps/docs/content/guides/auth/social-login/auth-facebook.mdx
+++ b/apps/docs/content/guides/auth/social-login/auth-facebook.mdx
@@ -99,6 +99,26 @@ Future<void> signInWithFacebook() async {
}
```
+</TabPanel>
+<TabPanel id="swift" label="Swift">
+
+When your user signs in, call [signInWithOAuth()](/docs/reference/swift/auth-signinwithoauth) with `facebook` as the `provider`:
+
+```swift
+func signInWithFacebook() async throws {
+ try await supabase.auth.signInWithOAuth(
+ provider: .facebook,
+ redirectTo: URL(string: "my.scheme://my-host")!, // Optionally set the redirect link to bring back the user via deeplink.
+ launchFlow: { url in
+ // use url to start OAuth flow
+ // and return a result url that contains the OAuth token.
+ // ...
+ return resultURL
+ }
+ )
+}
+```
+
</TabPanel>
<TabPanel id="kotlin" label="Kotlin">
@@ -143,6 +163,17 @@ Future<void> signOut() async {
}
```
+</TabPanel>
+<TabPanel id="swift" label="Swift">
+
+When your user signs out, call [signOut()](/docs/reference/swift/auth-signout) to remove them from the browser session and any objects from localStorage:
+
+```swift
+func signOut() async throws {
+ try await supabase.auth.signOut()
+}
+```
+
</TabPanel>
<TabPanel id="kotlin" label="Kotlin">