You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/blog/2025/05-20-bevy-ios-deep-linking/index.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ hidden=true
9
9
10
10
Until very recently Bevy iOS apps had a hard time reading deep linking information. Bevy uses [winit](https://github.com/rust-windowing/winit) by default for its platform integrations like window lifecycle management. On iOS winit used to implement and register its own `AppDelegate` to receive app life cycle hooks/calls.
11
11
12
-
Users of Bevy therefore had only one inconvenient options to receive these hooks: Ditch winit and roll this themselves.
12
+
Users of Bevy therefore had only one inconvenient option to receive these hooks: Ditch winit and roll this themselves.
13
13
14
14
As of `winit 0.30.10` ([see release](https://github.com/rust-windowing/winit/releases/tag/v0.30.10)) we can now do much better.
15
15
@@ -69,7 +69,7 @@ pub fn plugin(app: &mut App) {
69
69
// register our crates plugin (this is a noop on non ios platforms)
70
70
app.add_plugins(IosAppDelegatePlugin);
71
71
72
-
// register observer that triggers if open url app delegate was called (either by app opening or forgrounding after a click on a URL scheme)
72
+
// register observer that triggers if open url app delegate was called (either by app opening or foregrounding after a click on a URL scheme)
@@ -83,14 +83,14 @@ This is of course very application dependant. Here are a few example of what to
83
83
| Link action | App behaviour |
84
84
| --- | --- |
85
85
| game user profile link | App opens the user profile of the user that created the link |
86
-
| a players new record game run | The app shows this players replay after clicking their link |
86
+
| a player's new record game run | The app shows this player's replay after clicking their link |
87
87
| file sharing | A `ShareExtension` receives a file that it wants to share with your app and opens your app using a URL schema and the app can identify what file to open using the deep linking context |
88
88
89
89
# Further steps
90
90
91
91
**universal links**
92
92
93
-
Aside from the custom URL schema we described above a regular web domain can be associated with your app and trigger opening it, this is called *universal linking* ([see apple docs](https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app)) and requires yet another `AppDelegate`[call implementation](https://developer.apple.com/documentation/appkit/nsapplicationdelegate/application(_:continue:restorationhandler:)).
93
+
Aside from the custom URL schema we described above, a regular web domain can be associated with your app and trigger opening it, this is called *universal linking* ([see apple docs](https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app)) and requires yet another `AppDelegate`[call implementation](https://developer.apple.com/documentation/appkit/nsapplicationdelegate/application(_:continue:restorationhandler:)).
Copy file name to clipboardExpand all lines: docs/blog/2025/05-20-bevy-ios-deep-linking/index.html
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ <h1 class="title">
32
32
</h1>
33
33
<divclass="content">
34
34
<p>Until very recently Bevy iOS apps had a hard time reading deep linking information. Bevy uses <ahref="https://github.com/rust-windowing/winit">winit</a> by default for its platform integrations like window lifecycle management. On iOS winit used to implement and register its own <code>AppDelegate</code> to receive app life cycle hooks/calls.</p>
35
-
<p>Users of Bevy therefore had only one inconvenient options to receive these hooks: Ditch winit and roll this themselves.</p>
35
+
<p>Users of Bevy therefore had only one inconvenient option to receive these hooks: Ditch winit and roll this themselves.</p>
36
36
<p>As of <code>winit 0.30.10</code> (<ahref="https://github.com/rust-windowing/winit/releases/tag/v0.30.10">see release</a>) we can now do much better.</p>
37
37
<h1id="what-is-the-use-case">What is the use case?</h1>
38
38
<p>"Deep linking" means that a link leads to our app being opened or foregrounded and the app knowing <em>that</em> and <em>what</em> url triggered it. The iOS jargon for this is <ahref="https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app">URL Scheme</a>. Some example use cases for this are:</p>
@@ -78,7 +78,7 @@ <h2 id="receive-app-open-options">Receive app open options</h2>
78
78
</span><span></span><spanstyle="font-style:italic;color:#4a4a4a;">// register our crates plugin (this is a noop on non ios platforms)
</span><span></span><spanstyle="font-style:italic;color:#4a4a4a;">// register observer that triggers if open url app delegate was called (either by app opening or forgrounding after a click on a URL scheme)
81
+
</span><span></span><spanstyle="font-style:italic;color:#4a4a4a;">// register observer that triggers if open url app delegate was called (either by app opening or foregrounding after a click on a URL scheme)
<tr><td>game user profile link</td><td>App opens the user profile of the user that created the link</td></tr>
91
-
<tr><td>a players new record game run</td><td>The app shows this players replay after clicking their link</td></tr>
91
+
<tr><td>a player's new record game run</td><td>The app shows this player's replay after clicking their link</td></tr>
92
92
<tr><td>file sharing</td><td>A <code>ShareExtension</code> receives a file that it wants to share with your app and opens your app using a URL schema and the app can identify what file to open using the deep linking context</td></tr>
93
93
</tbody></table>
94
94
<h1id="further-steps">Further steps</h1>
95
95
<p><strong>universal links</strong></p>
96
-
<p>Aside from the custom URL schema we described above a regular web domain can be associated with your app and trigger opening it, this is called <em>universal linking</em> (<ahref="https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app">see apple docs</a>) and requires yet another <code>AppDelegate</code><ahref="https://developer.apple.com/documentation/appkit/nsapplicationdelegate/application(_:continue:restorationhandler:)">call implementation</a>.</p>
96
+
<p>Aside from the custom URL schema we described above, a regular web domain can be associated with your app and trigger opening it, this is called <em>universal linking</em> (<ahref="https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app">see apple docs</a>) and requires yet another <code>AppDelegate</code><ahref="https://developer.apple.com/documentation/appkit/nsapplicationdelegate/application(_:continue:restorationhandler:)">call implementation</a>.</p>
97
97
<p><strong>push notification token</strong></p>
98
98
<p>Being able to make a custom <code>AppDelegate</code> implementation has more advantage than just for deep linking. We can now vastly simplify also the way we currently receive a push notification token in the <ahref="https://github.com/rustunit/bevy_ios_notifications">bevy_ios_notifications</a> crate. Receiving this token also happens via <code>AppDelegate</code> call and will be provided via the new <code>bevy_ios_app_delegate</code> crate soon.</p>
99
99
<p>Exciting times to build iOS apps using Bevy.</p>
0 commit comments