deep linking

Eduardo Gomez 3,431 Reputation points
2024-01-16T00:53:49.7266667+00:00

I implemented this in Android and I tested it by sending an email to myself with a meeting url

[IntentFilter([Intent.ActionView],
                    DataScheme = "https",
                    DataHost = "demy-ia.daily.co",
                    DataPathPattern = "/.*",
                    AutoVerify = true,
                    Categories = [Intent.CategoryDefault, Intent.CategoryBrowsable])]
public class MainActivity : MauiAppCompatActivity {
    protected override void OnNewIntent(Intent? intent) {
        base.OnNewIntent(intent);

        var res = intent!.Data;

        Console.WriteLine(res);
    }


On windows, I have

<Extensions>
	<uap:Extension Category="windows.protocol">
		<uap:Protocol Name="demyai"/>
	</uap:Extension>

and

                .ConfigureSyncfusionCore()
                .ConfigureLifecycleEvents(events => {
#if WINDOWS
                    events.AddWindows(windows => windows
                            .OnLaunched((window, args) => {

                                var parameters = Environment.GetCommandLineArgs();
                                if(parameters != null) {
                                    Console.WriteLine(parameters);
                                }
                            }));
#endif
                })


I tested the code, and I get that the value of parameter is.

C:\Users\egome\Documents\StartUp\DemyAI\bin\Debug\net8.0-windows10.0.19041.0\win10-x64\AppX\DemyAI.dll User's image

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,900 questions
{count} votes

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 48,096 Reputation points Microsoft Vendor
    2024-01-17T02:11:19.5333333+00:00

    Hello,

    The reason for this error is that <uap:LaunchActivation> which is not a child element of uap:Protocol.

    Please refer to uap:Protocol (Windows 10) for more details.

    So, the URI Should be the same as Android?

    No, the URI of the WinUI launcher is not the same as the Android format.

    Solution:

    Different platforms should use different URLs to launch the program for the corresponding platform, and this function should be done on the sender, not the receiver.

    When there are some matching problems, you should consider how to get the sending party to match the receiver.

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.