Skip to content

fix android deeplink activation#22301

Merged
jeromelaban merged 3 commits into
unoplatform:masterfrom
ajpinedam:dev/anpi/fix.android.deeplink.activation
Jan 8, 2026
Merged

fix android deeplink activation#22301
jeromelaban merged 3 commits into
unoplatform:masterfrom
ajpinedam:dev/anpi/fix.android.deeplink.activation

Conversation

@ajpinedam

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #22300

PR Type:

  • 🐞 Bugfix

What is the current behavior? 🤔

What is the new behavior? 🚀

PR Checklist ✅

Please check if your PR fulfills the following requirements:

Other information ℹ️

@ajpinedam ajpinedam self-assigned this Jan 7, 2026
Copilot AI review requested due to automatic review settings January 7, 2026 21:00
@github-actions github-actions Bot added the area/skia ✏️ Categorizes an issue or PR as relevant to Skia label Jan 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Android deeplink activation by ensuring that protocol activation events are properly handled on Android Skia builds. The fix addresses the issue where deeplinks received before the application is fully running would not trigger the OnActivated event correctly.

Key changes:

  • Enables ProtocolActivatedEventArgs constructor across all platforms by removing platform-specific conditional compilation
  • Implements deferred protocol activation for Android Skia using a ThreadStatic storage mechanism
  • Updates generated code to reflect the platform availability changes

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Activation/ProtocolActivatedEventArgs.cs Simplifies conditional compilation directives from multi-platform checks to #if false, effectively disabling the generated implementations in favor of the partial class implementations
src/Uno.UWP/ApplicationModel/Activation/ProtocolActivatedEventArgs.cs Removes __APPLE_UIKIT__ || __ANDROID__ || __WASM__ conditional compilation, making the constructor available on all platforms including Android Skia
src/Uno.UI/UI/Xaml/NativeApplication.cs Adds Android Skia-specific logic to defer protocol activation when the app is not yet running, storing the URI for later activation
src/Uno.UI/UI/Xaml/Application.skia.cs Introduces _activationUri ThreadStatic field and SetActivationUri method to store deferred activation URIs, then triggers OnActivated after OnLaunched completes on Android
Comments suppressed due to low confidence (1)

src/Uno.UWP/ApplicationModel/Activation/ProtocolActivatedEventArgs.cs:30

  • The platform-specific conditional compilation directive has been removed, making this constructor available on all platforms. However, there's no corresponding test coverage to verify that deeplink activation works correctly across all platforms, especially for the Android Skia scenario this PR is fixing. Consider adding runtime tests in the Uno.UI.RuntimeTests project to verify protocol activation behavior, particularly testing the deferred activation scenario where the app is not running when the deeplink is received.
		/// <summary>
		/// Internal-only constructor for protocol activation.
		/// </summary>
		/// <param name="uri">Activated uri.</param>
		/// <param name="previousExecutionState">Previous execution state.</param>
		internal ProtocolActivatedEventArgs(Uri uri, ApplicationExecutionState previousExecutionState)
		{
			Uri = uri;
			PreviousExecutionState = previousExecutionState;
		}

Comment thread src/Uno.UI/UI/Xaml/Application.skia.cs
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@ajpinedam

Copy link
Copy Markdown
Contributor Author

This is a WA until @MartinZikmund PR is merged #20027 which is fixing/updating the app activation for both iOS and Android

@jeromelaban jeromelaban merged commit 05df1c8 into unoplatform:master Jan 8, 2026
57 of 60 checks passed
@ajpinedam

Copy link
Copy Markdown
Contributor Author

/unobot backport release/stable/6.4

jeromelaban added a commit that referenced this pull request Jan 9, 2026
…bp22301

fix android deeplink activation (backport #22301)
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area/skia ✏️ Categorizes an issue or PR as relevant to Skia

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Skia] Android Deep link with Url is crashing the app

5 participants