【问题标题】:How To Open App From Link And not play store - Android [duplicate]如何从链接打开应用程序而不是玩商店 - Android [重复]
【发布时间】:2019-09-01 07:04:55
【问题描述】:

我想检查是否安装了应用程序然后打开应用程序,如果没有则播放商店。我尝试使用我的应用的 Play 商店链接,但没有成功

   <intent-filter
        android:autoVerify="true"
        android:label="Notification Log">
        <action android:name="android.intent.action.VIEW" />

        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data
            
            android:host="play.google.com"
            android:path="/store/apps/details?id=com.appnotification.notificationhistorylog"
            android:scheme="http" />
    </intent-filter>

谁能帮我解决这个问题

【问题讨论】:

    标签: android deep-linking


    【解决方案1】:

    它通过将 Playstore 链接更改为短 URL 来工作

       <data
    
                android:host="bit.ly"
                android:path="/yourappname"
                android:scheme="http" />

    【讨论】:

      【解决方案2】:

      更新

      <intent-filter>
          <action android:name="android.intent.action.VIEW"/>
      
          <category android:name="android.intent.category.DEFAULT"/>
          <category android:name="android.intent.category.BROWSABLE"/>
      
          <data
              android:host="www.this-so-does-not-exist.com"
              android:path="/something"
              android:scheme="http"
              android:pathPattern="/.*"/>
      </intent-filter>
      

      然后,指向http://www.this-so-does-not-exist.com/something 的链接将在安装了您的应用程序的设备上显示您的应用程序(在选择器中以及 Web 浏览器中),并在没有安装您的应用程序的设备上显示您的网页。

      【讨论】:

      • 但是当我想打开我自己的应用程序时这会起作用
      • 以上代码将放置在您的应用程序中,以检查您正在使用的包 id 的应用程序是否已安装。如果安装了,它将打开应用程序,如果没有,它将在 PlayStore 上打开它
      • 但是如果上面的应用程序本身没有安装怎么办
      • 我在说什么 - 我的应用程序名称是“A”,并且我已经在我的网站上放置了“A”的 playstore 链接,如果安装了应用程序,则打开应用程序而不是转到 playstore
      • 您想从网站导航?
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-04-03
      • 2012-07-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-16
      相关资源
      最近更新 更多