Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/201.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在android应用程序中捕获customurlscheme?_C#_Android_Xamarin_Url Scheme - Fatal编程技术网

C# 在android应用程序中捕获customurlscheme?

C# 在android应用程序中捕获customurlscheme?,c#,android,xamarin,url-scheme,C#,Android,Xamarin,Url Scheme,当前使用CustomTabs/NativeUI和Xamarin.Auth通过自定义web api向Google验证Android应用程序(我无法编辑/更改web api)。是否可以拦截url(https)并在到达此url后返回到应用程序?或者,由于chrome已经打开,这对自定义选项卡不起作用 意向过滤器代码: [ IntentFilter ( actions: new[] { Intent.ActionView }, Categories = n

当前使用
CustomTabs/Native
UI和
Xamarin.Auth
通过自定义web api向Google验证Android应用程序(我无法编辑/更改web api)。是否可以拦截url(https)并在到达此url后返回到应用程序?或者,由于chrome已经打开,这对自定义选项卡不起作用

意向过滤器代码:

[
    IntentFilter
    (
        actions: new[] { Intent.ActionView },
        Categories = new[]
                {
                    Intent.CategoryDefault,
                    Intent.CategoryBrowsable
                },
        DataSchemes = new[]
                {
                    "https://redirectwebsite.com/"
                },
        DataPath = "https"
    )
]

布莱恩,我们不是在社区闲暇时间交流吗

请救救我。在slack(3个团队)、论坛和github之间切换上下文让我浑身不舒服,而我不是i7

您发布的代码中有大量错误:

  • 这不是DataScheme,而是DataScheme中的URL/URI/URN。在本例中,它应该仅为https。但对于本机ui,这是不对的,因为您需要自定义方案
  • 
    "https://redirectwebsite.com/"
    

    是的,有一些教程可以在Android上使用http[s]进行深度链接(应用程序链接),但我没能做到

    请尽量少做样品,让我高兴(学习一些东西)。

    解决方案: 通过更改我的意图过滤器,我成功地导航回我的android应用程序并获取令牌信息:

     [IntentFilter
        (
        actions: new[] { Intent.ActionView }, 
        Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable },
        DataSchemes = new[] { "https" }, 
        DataHost = "redirectwebsite.net",
        DataPath = "/", 
        AutoVerify = true
        )
    ]
    

    对我们在空闲时间进行交流,我目前正在学习一些关于应用程序链接的教程(运气不好),如果我能让它正常工作,我会在空闲时间发布一些东西。我也试过了,但不能浪费太多时间。我无法使http[s]方案工作。也许DataHosts和DataPath可以帮助更好地过滤它,但我认为问题在于scheme本身。