【发布时间】:2018-05-27 09:47:25
【问题描述】:
我在我的 iOS 应用上实现了 Firebase 动态链接(非常棒!),现在我在 Android 上做同样的工作。 我设法通过单击动态 URL 来启动我的 Android 应用程序,但我无法在启动器活动之外的其他活动上打开它。
这是我的 manifest.xml 文件:
<activity android:name=".Activity.SplashActivity"
android:theme="@style/SplashTheme"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Activity.RouteListActivity"
android:screenOrientation="portrait">
<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="mywebsite.com" android:scheme="http"/>
<data android:host="mywebsite.com" android:scheme="https"/>
<data
android:host="myapp.app.goo.gl/"
android:scheme="https" />
</intent-filter>
</activity>
当我单击 URL 时,浏览器会打开并重定向到我的应用,但它会在 SplashActivity 上打开,而不是在 RouteListActivity 上按预期打开。
我错过了什么吗?
谢谢
【问题讨论】:
-
从
android:host属性中删除最后一个/ -
@SimonMarquis 好的,我已经删除了它,但没有任何变化。我的应用程序仍在由我的启动器活动打开,而不是 RouteListActivity
-
您不需要
myapp.app.goo.gl条目 - 您可以尝试删除它吗? (并检查 mywebsite 条目上的任何其他尾随数据。 -
@IanBarber 好的,我删除了它,但没有成功。尾随数据是什么意思?谢谢
-
@JorgeAmVF :不,我必须通过创建一个调用所需活动的意图来解决这个问题。这是通过 FirebaseDynamicLinks OnSuccessListener 接口在我的启动器活动中完成的。
标签: android firebase deep-linking firebase-dynamic-links