在我们的应用程序中,我们使用的是深度链接。它们在应用程序打开或在后台运行时工作,但在应用程序完全关闭时不工作。应用程序打开,但OnNewIntent和OnAppLinkRequestReceived都未调用。我尝试将Intent过滤器从MainActivity移动到SplashActivity,但没有成功。有办法解决吗?
4ngedf3f1#
以下是为Xamarin.Android应用程序创建DeepLinking的步骤。首先,请在MainActivity中添加IntentFilter。这里是示例供您参考。
[IntentFilter(new[] { Android.Content.Intent.ActionView }, DataScheme = "https", DataHost = "example.com", DataPathPrefix ="/", Categories = new[] { Android.Content.Intent.CategoryDefault,Android.Content.Intent.CategoryBrowsable })]
字符串此外,您不需要在Manifest中设置Intent过滤器,c#将帮助您在Manifest中构建配置。然后您可以创建一个html链接来测试Deeplinking。应用程序打开,但OnNewIntent和OnAppLinkRequestReceived都未调用。对于这个问题,你可以在android manifest中添加android:launchMode="singleTask"来创建一个新的任务,一个新的示例将被推送到任务中作为根示例。
android:launchMode="singleTask"
1条答案
按热度按时间4ngedf3f1#
以下是为Xamarin.Android应用程序创建DeepLinking的步骤。
首先,请在MainActivity中添加IntentFilter。这里是示例供您参考。
字符串
此外,您不需要在Manifest中设置Intent过滤器,c#将帮助您在Manifest中构建配置。然后您可以创建一个html链接来测试Deeplinking。
应用程序打开,但OnNewIntent和OnAppLinkRequestReceived都未调用。
对于这个问题,你可以在android manifest中添加
android:launchMode="singleTask"
来创建一个新的任务,一个新的示例将被推送到任务中作为根示例。