Facebook 在他们的网络视图中打开混合应用程序
facebook opening hybrid app in their webview
我正在 ionic framework
开发移动设备,我正在为应用程序使用自定义方案 url。
我正在处理的功能:
当用户在 facebook 上分享任何内容时,当其他用户点击该 facebook 分享时 link 如果他们安装了应用程序,他们将重定向到应用程序内的共享内容详细信息页面,否则它将重定向到 apple 或google 玩商店。
问题:
当用户在 Facebook 上单击该共享 link 时,应用程序将在 Facebook 网络视图中打开,而不是打开应用程序本身。
有人遇到过这样的问题吗?还是我做错了什么?
平台:
- 应用程序的 Ionic 框架
- PHP 用于后端。
PHP 将用户重定向到应用程序的代码:
header("Location: MYAPP://eventpage/eventID");
查看我的应用 AndroidManifest.xml
后,我发现了以下偏好:
<activity android:name="MainActivity" android:launchMode="singleTop"
我阅读了 Android Document 并发现了以下几行。
As shown in the table below, the modes fall into two main groups, with
"standard" and "singleTop" activities on one side, and "singleTask"
and "singleInstance" activities on the other. An activity with the
"standard" or "singleTop" launch mode can be instantiated multiple
times.
所以我更改了我的 Manifest 如下,它工作正常。
<activity android:name="MainActivity" android:launchMode="singleInstance"
^^^^^^^^^^^^^^^^
我正在 ionic framework
开发移动设备,我正在为应用程序使用自定义方案 url。
我正在处理的功能:
当用户在 facebook 上分享任何内容时,当其他用户点击该 facebook 分享时 link 如果他们安装了应用程序,他们将重定向到应用程序内的共享内容详细信息页面,否则它将重定向到 apple 或google 玩商店。
问题:
当用户在 Facebook 上单击该共享 link 时,应用程序将在 Facebook 网络视图中打开,而不是打开应用程序本身。
有人遇到过这样的问题吗?还是我做错了什么?
平台:
- 应用程序的 Ionic 框架
- PHP 用于后端。
PHP 将用户重定向到应用程序的代码:
header("Location: MYAPP://eventpage/eventID");
查看我的应用 AndroidManifest.xml
后,我发现了以下偏好:
<activity android:name="MainActivity" android:launchMode="singleTop"
我阅读了 Android Document 并发现了以下几行。
As shown in the table below, the modes fall into two main groups, with "standard" and "singleTop" activities on one side, and "singleTask" and "singleInstance" activities on the other. An activity with the "standard" or "singleTop" launch mode can be instantiated multiple times.
所以我更改了我的 Manifest 如下,它工作正常。
<activity android:name="MainActivity" android:launchMode="singleInstance"
^^^^^^^^^^^^^^^^