Skip to content

Support activation with universal links #18005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 22, 2025
Merged

Conversation

kerams
Copy link
Contributor

@kerams kerams commented Jan 20, 2025

What does the pull request do?

Implements #17600

What is the current behavior?

IAvaloniaAppDelegate.Activated is raised with ActivatedEventArgs.

What is the updated/expected behavior with this PR?

IAvaloniaAppDelegate.Activated is raised with ProtocolActivatedEventArgs containing the URL that activated the application.

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0054347-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@cla-avalonia
Copy link
Collaborator

cla-avalonia commented Jan 20, 2025

  • All contributors have signed the CLA.

@kerams
Copy link
Contributor Author

kerams commented Jan 20, 2025

Tested the build in my application, and it works OK. I still see the potential problem of cold starts, where subscribing to Activated might be delayed for whatever reason, until after the event has been raised. Not sure there's a good solution to this other than storing the activation information somewhere, so that it can be checked on demand at a later point.

On second thought, it looks like continueUserActivity is called after didFinishLaunchingWithOptions, which invokes CreateAppBuilder, so as long as the user subscribes in Create/CustomizeAppBuilder, this isn't an issue.

@kerams
Copy link
Contributor Author

kerams commented Jan 20, 2025

@cla-avalonia agree

@maxkatz6
Copy link
Member

On second thought, it looks like continueUserActivity is called after didFinishLaunchingWithOptions, which invokes CreateAppBuilder, so as long as the user subscribes in Create/CustomizeAppBuilder, this isn't an issue.

Does it work, if user subscribes in OnFrameworkInitializationCompleted method? It should still be called from the didFinishLaunchingWithOptions.
In our documentation we use OnFrameworkInitializationCompleted as an example for these events.

@kerams
Copy link
Contributor Author

kerams commented Jan 22, 2025

Going down the stack from

Instance.OnFrameworkInitializationCompleted();
I end up in didFinishLaunchingWithOptions, so I think we're fine.

@maxkatz6 maxkatz6 added enhancement and removed bug labels Jan 22, 2025
@maxkatz6 maxkatz6 added this pull request to the merge queue Jan 22, 2025
Merged via the queue into AvaloniaUI:master with commit c15dc0d Jan 22, 2025
11 checks passed
@kerams kerams deleted the uni branch January 22, 2025 22:12
@maxkatz6 maxkatz6 added the backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch label Jan 29, 2025
@CastelloBrancoTecnologia
Copy link

CastelloBrancoTecnologia commented Feb 11, 2025

Does this work with macos too ? I am not getting urls on desktop too

@maxkatz6
Copy link
Member

This PR only affects iOS backend. For macOS, you typically can use protocol links (i.e. CFBundleURLTypes ones).

@CastelloBrancoTecnologia
Copy link

CastelloBrancoTecnologia commented Feb 12, 2025

Not working on macos too. Cant get url with protocol links and last version of avalonia

@maxkatz6 maxkatz6 added backported-11.2.x and removed backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants