Skip to content

Commit 15cd08d

Browse files
committed
some fixes
1 parent 84e2c8b commit 15cd08d

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

  • content/blog/2025/05-20-bevy-ios-deep-linking
  • docs/blog/2025/05-20-bevy-ios-deep-linking

content/blog/2025/05-20-bevy-ios-deep-linking/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ hidden=true
99

1010
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.
1111

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.
1313

1414
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.
1515

@@ -69,7 +69,7 @@ pub fn plugin(app: &mut App) {
6969
// register our crates plugin (this is a noop on non ios platforms)
7070
app.add_plugins(IosAppDelegatePlugin);
7171

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)
7373
app.add_observer(|trigger: Trigger<AppDelegateCall>| {
7474
info!("app delegate call: {:?}", trigger.event());
7575
});
@@ -83,14 +83,14 @@ This is of course very application dependant. Here are a few example of what to
8383
| Link action | App behaviour |
8484
| --- | --- |
8585
| 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 |
8787
| 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 |
8888

8989
# Further steps
9090

9191
**universal links**
9292

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:)).
9494

9595
**push notification token**
9696

docs/blog/2025/05-20-bevy-ios-deep-linking/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ <h1 class="title">
3232
</h1>
3333
<div class="content">
3434
<p>Until very recently Bevy iOS apps had a hard time reading deep linking information. Bevy uses <a href="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>
3636
<p>As of <code>winit 0.30.10</code> (<a href="https://github.com/rust-windowing/winit/releases/tag/v0.30.10">see release</a>) we can now do much better.</p>
3737
<h1 id="what-is-the-use-case">What is the use case?</h1>
3838
<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 <a href="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>
7878
</span><span> </span><span style="font-style:italic;color:#4a4a4a;">// register our crates plugin (this is a noop on non ios platforms)
7979
</span><span> app</span><span style="color:#89ddff;">.</span><span style="color:#82aaff;">add_plugins</span><span style="color:#89ddff;">(</span><span>IosAppDelegatePlugin</span><span style="color:#89ddff;">);
8080
</span><span>
81-
</span><span> </span><span style="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><span style="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)
8282
</span><span> app</span><span style="color:#89ddff;">.</span><span style="color:#82aaff;">add_observer</span><span style="color:#89ddff;">(|</span><span style="color:#f78c6c;">trigger</span><span style="color:#89ddff;">: </span><span>Trigger</span><span style="color:#89ddff;">&lt;</span><span>AppDelegateCall</span><span style="color:#89ddff;">&gt;| {
8383
</span><span> info!</span><span style="color:#89ddff;">(&quot;</span><span style="color:#c3e88d;">app delegate call: {:?}</span><span style="color:#89ddff;">&quot;,</span><span> trigger</span><span style="color:#89ddff;">.</span><span style="color:#82aaff;">event</span><span style="color:#89ddff;">());
8484
</span><span> </span><span style="color:#89ddff;">});
@@ -88,12 +88,12 @@ <h2 id="handle-deep-link">Handle deep link</h2>
8888
<p>This is of course very application dependant. Here are a few example of what to do:</p>
8989
<table><thead><tr><th>Link action</th><th>App behaviour</th></tr></thead><tbody>
9090
<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>
9292
<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>
9393
</tbody></table>
9494
<h1 id="further-steps">Further steps</h1>
9595
<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> (<a href="https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app">see apple docs</a>) and requires yet another <code>AppDelegate</code> <a href="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> (<a href="https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app">see apple docs</a>) and requires yet another <code>AppDelegate</code> <a href="https://developer.apple.com/documentation/appkit/nsapplicationdelegate/application(_:continue:restorationhandler:)">call implementation</a>.</p>
9797
<p><strong>push notification token</strong></p>
9898
<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 <a href="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>
9999
<p>Exciting times to build iOS apps using Bevy.</p>

0 commit comments

Comments
 (0)