Android浏览器意图打开Play商店而不是应用程序。

huangapple go评论78阅读模式
英文:

Android browser intent opening playstore instead of app

问题

我正在使用以下意图URL在我的网站上打开我的Android应用程序:

intent:<someContextForTheApp>#Intent;scheme=<appScheme>;action=android.intent.action.VIEW;S.browser_fallback_url=<urlToAppPageInPlaystore>;end

应用程序包含一个适当的意图过滤器,以接受上述目标方案。浏览器回退URL是指向我的应用程序在Play商店页面的链接。因此,当用户点击此意图URL时,如果应用程序已安装,它应该打开应用程序;如果应用程序未安装,它应该打开Play商店页面。

这个流程一直运行得很好,直到最近突然出现问题。现在每次都会打开Play商店,即使应用程序已安装。我不明白为什么尽管应用程序已安装,它也不会打开应用程序。

非常奇怪的是,我创建了一个包含完全相同意图URL的.html文件作为链接。当我在.html文件中点击该链接时,应用程序确实会打开。它在这个.html文件中有效,但在我的网站上却不起作用。有人知道这可能是什么问题吗?

英文:

I am using the following intent url in my website to open my android app:

intent:<someContextForTheApp>#Intent;scheme=<appScheme>;action=android.intent.action.VIEW;S.browser_fallback_url=<urlToAppPageInPlaystore>;end

The app contains an appropriate intent filter to accept the above mentioned target scheme. The browser fallback url is a link to the playstore page for my app. So when the user clicks on this intent url- if the app is installed it should open the app; and if the app is not installed it should open the playstore page.

This flow was working fine up until recently. Suddenly this seems to be broken- now it opens playstore every time.. even if app is installed. I dont understand why it's not opening the app even though the app is installed.

What is extremely weird is that i created an .html file with this very same intent url as a link. And when i click on that link in the .html file, the app does open. It works in this .html file but it doesn't work for my website. Does anyone know what might be the problem here?

答案1

得分: 1

你可能需要一个明确的“Intent”,尝试像这样添加您应用程序的包名:

intent:<someContextForTheApp>#Intent;scheme=<appScheme>;package=your.app.package;action=android.intent.action.VIEW;S.browser_fallback_url=<urlToAppPageInPlaystore>;end
英文:

You probably need an explicit Intent, try adding your app's package name like this:

intent:<someContextForTheApp>#Intent;scheme=<appScheme>;package=your.app.package;action=android.intent.action.VIEW;S.browser_fallback_url=<urlToAppPageInPlaystore>;end

huangapple
  • 本文由 发表于 2023年6月15日 03:48:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/76477079.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定