Skip to content

Conversation

@DeD1rk
Copy link
Member

@DeD1rk DeD1rk commented Mar 5, 2021

Migrate to Router/Navigator 2.0 to support Deep Linking.
Add deep linking configuration for 'thaliapp://thalia.nu/' and 'https://thalia.nu/' links.
This should work, but somehow it does not. Deep Links open the app, but the url is
not actually being parsed by the RouteInformationParser. The parser is only called
with "/" upon starting the app.

The deep linking has to be fixed.
After that the routerDelegate should be improved a bit, as described by TODO comments.

Closes #22

DeD1rk added 7 commits March 4, 2021 19:07
To allow for deep linking, and generally make the navigation more
more flexible, we need to use the new navigation system Router (Navigator 2.0)
This commit emulates the behavior of the old router. Instead of
```
Navigator.push(
  context,
  MaterialPageRoute(...),
);
```
we can now use
```
MyRouterDelegate.of(context).push(MyPage(child: ...));
```
Update packages so we can use flutter 2.0. This seems to fix deep
linking with Router. Currently, with flutter 2.0.1, deep linking
does not work on android. It couses a crash, as described in
flutter/flutter#75261. The fix to this
issue has been merged, but apparantly it's not included in the
release 2.0.1.
The deep links are now only with custom scheme "thaliapp://".
For universal links (https), we need to work with the website.
@DeD1rk
Copy link
Member Author

DeD1rk commented Mar 7, 2021

Deeplinking works now, on the flutter master channel. On android, Dee-links cause a crash if on the stable channel. This is fixed in flutter/engine#24146, which is apparently not included in the 2.0.1 stable branch:

Flutter 2.0.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision c5a4b4029c (3 days ago) • 2021-03-04 09:47:48 -0800
Engine • revision 40441def69

It is included in master:

Flutter 2.1.0-11.0.pre.145 • channel master • https://github.com/flutter/flutter.git
Framework • revision a0ba646408 (2 days ago) • 2021-03-05 22:09:03 -0500
Engine • revision f751d04fa0

To switch to the master channel, run flutter channel master && flutter upgrade. I assume that the necessary changes will appear in 2.1.0 on stable before we publish.

@DeD1rk DeD1rk requested a review from KiOui March 7, 2021 17:22
@DeD1rk
Copy link
Member Author

DeD1rk commented Mar 7, 2021

Btw, currently deep linking works for thaliapp://thalia.nu/ links. To enable https://thalia.nu/ links we need to do this for android and this for iOS on concrexit.

DeD1rk added 2 commits March 15, 2021 22:03
Rename routerDelegate and routInformationParser

Check for login in routerDelegate, deprecating SplashScreen. If a link
is opened while logged out, the stack is replaced with a login screen,
so the link is lost. No other page can be opened while logged out.

Fix deep link patterns
Switch deep link schemes to https
@DeD1rk DeD1rk marked this pull request as ready for review March 15, 2021 21:25
@DeD1rk DeD1rk merged commit 59ae3ae into master Mar 15, 2021
@DeD1rk DeD1rk deleted the feature/deep-linking branch March 15, 2021 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deep linking

3 participants