Skip to content

Commit a2cd408

Browse files
grdsdevcharislamthorwebdev
authored
docs: add getting started guide for Swift (supabase#19044)
* docs: getting started guide for Swift * Apply suggestions from code review Co-authored-by: Charis <[email protected]> * Add new tutorial to menu * Add correct image for tutorial * style: format with-swift tutorial * docs: add example to the repository --------- Co-authored-by: Charis <[email protected]> Co-authored-by: Thor 雷神 Schaeff <[email protected]>
1 parent ee18b5a commit a2cd408

File tree

20 files changed

+1174
-0
lines changed

20 files changed

+1174
-0
lines changed

apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts

+4
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,10 @@ export const gettingstarted: NavMenuConstant = {
318318
name: 'Ionic Angular',
319319
url: '/guides/getting-started/tutorials/with-ionic-angular',
320320
},
321+
{
322+
name: 'Swift',
323+
url: '/guides/getting-started/tutorials/with-swift',
324+
},
321325
],
322326
},
323327
],

apps/docs/pages/guides/auth/native-mobile-deep-linking.mdx

+38
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,44 @@ In certain auth scenarios you will need to handle linking back into your applica
307307
</TabPanel>
308308
</Tabs>
309309
</TabPanel>
310+
311+
<TabPanel id="swift" label="Swift">
312+
### Deep link config
313+
314+
1. Go to your [auth settings](https://supabase.com/dashboard/project/_/auth/url-configuration) page.
315+
2. Enter your app redirect URL in the `Additional Redirect URLs` field. This is the URL that the user gets redirected to after clicking a magic link.
316+
317+
The redirect callback url should have the format `[YOUR_SCHEME]://[YOUR_HOSTNAME]`. Here, `io.supabase.user-management://login-callback` is just an example. You can choose whatever you would like for `YOUR_SCHEME` and `YOUR_HOSTNAME` as long as the scheme is unique across the user's device. For this reason, typically a reverse domain of your website is used.
318+
319+
![Supabase console deep link setting](/docs/img/deeplink-setting.png)
320+
321+
Now add a cutom URL to your application, so the OS knows how to redirect back your application once the user clicks the magic link.
322+
323+
You have the option to use Xcode's Target Info Editor following [official Apple documentation](https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app#Register-your-URL-scheme).
324+
325+
Or, declare the URL scheme manually in your `Info.plist` file.
326+
327+
```xml Info.plist
328+
<?xml version="1.0" encoding="UTF-8"?>
329+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
330+
<plist version="1.0">
331+
<dict>
332+
<!-- other tags -->
333+
<key>CFBundleURLTypes</key>
334+
<array>
335+
<dict>
336+
<key>CFBundleTypeRole</key>
337+
<string>Editor</string>
338+
<key>CFBundleURLSchemes</key>
339+
<array>
340+
<string>io.supabase.user-management</string>
341+
</array>
342+
</dict>
343+
</array>
344+
</dict>
345+
</plist>
346+
```
347+
</TabPanel>
310348
</Tabs>
311349

312350

0 commit comments

Comments
 (0)