DeepLink 打开应用程序但在应用程序进入后台之前不会触发回调

DeepLink opens app but callback in not firing until the app goes to background

已编辑:

Right now my only issue with deep linking is that whenever i click deeplink and My application is not running it will open my HomeActivity and deeplinked Activity in background. If i press back button from HomeActivity my app minimizes and when i start it again deeplink Activity gets called only then and is redirected to correct Activity.

大家好,我想从此参考实施 Facebook 深度链接 https://developers.facebook.com/docs/app-ads/deep-linking。 我成功了,但如果我的应用程序不是 运行ning,它只是在从 Facebook 应用程序单击深度链接时将我重定向到主屏幕。我似乎找不到解决方案,谁能帮帮我?

我已按照说明一步步操作:

已创建 FB 应用 将 FB SDK 添加到 Android 应用 当我 运行 应用程序时,它被 Facebook 检测到,并在 https://developers.facebook.com/tools/app-ads-helper/

上验证
<activity
        android:name=".activities.FacebookAdActivity"
        android:launchMode="singleTask"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme">

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <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:scheme="com.example.myapp" />
        </intent-filter>
    </activity>

您 AndroidManifest.xml 中的 <data> 标签应该如下所示 -

<data android:scheme="yourScheme" android:host="com.your.package"
                    android:pathPrefix="/FacebookAdActivity"/>

在facebook中提供完整路径yourScheme://com.your.package/FacebookAdActivity这应该直接打开广告Activity