小编JSt*_*hen的帖子

Android深层链接不遵循路径前缀

我能找到的最接近的就是这个问题在这里.但它并没有完全覆盖我的问题.

我的应用设置中有深层链接,使用/ app作为路径前缀.我遇到的问题是类似http://example.com/upgrade的链接也试图在我的应用程序中打开,即使它在网址中没有/ app.我明白你不能排除前缀指定的网址,但不是只包含那些网址的路径前缀的整点?

基本上我想要像这样的链接深层链接:

http://example.com/app/home
http://example.com/app/specials
Run Code Online (Sandbox Code Playgroud)

但不是这样的链接:

http://exaple.com/
http://example.com/login
Run Code Online (Sandbox Code Playgroud)

这是我在我的清单中所拥有的:

<data android:scheme="http"
    android:host="example.com"
    android:pathPrefix="/app"/>
Run Code Online (Sandbox Code Playgroud)

编辑1

也找到了这个链接,但我没有任何空前缀,只有一个斜线"/"

编辑2

触发它的网址是http://example.com/upgrade.php?app=1&method=1&uid=1,我不确定应用程序之后是否?也会触发它所以我将前缀更改为/ application但是也没有用,它仍然触发它们.

编辑3

以下是清单中的其他深层链接数据标记:

资料活动

<data android:scheme="myapp"
    android:host="profile"
    android:pathPrefix="/"/>
Run Code Online (Sandbox Code Playgroud)

登录/注册活动

<data android:scheme="myapp"
     android:host="login"
     android:pathPrefix="/signup"/>
Run Code Online (Sandbox Code Playgroud)

主要活动

<data android:scheme="myapp"
     android:host="main"
     android:pathPrefix="/"/>

<data android:scheme="http"
     android:host="test.example.com"
     android:pathPrefix="/app"/>

<data android:scheme="http"
     android:host="live.example.com"
     android:pathPrefix="/app"/>
Run Code Online (Sandbox Code Playgroud)

编辑4

这变得越来越混乱,如果我从活动中删除myapp作为方案的数据标记(或者如果我从前缀为"/"的所有内容中删除pathPrefix)它不再触发来自web urls的深层链接,即使他们有/ app.

android deep-linking

12
推荐指数
2
解决办法
8235
查看次数

更新 Woocommerce 3 中的产品可见性

我正在使用几个带有 woocommerce/wordpress 的插件来制作它,这样我的每个产品变体都会作为单独的产品显示在我的产品列表中,但每种颜色中只设置一种显示(所以如果我有一个产品有 3 种尺寸和 3 个颜色,有 9 个产品,但由于每种颜色只能看到一个,因此列表中只显示了 3 个产品。)。我编写了一个脚本,一旦当前可见的产品缺货,它就会将可见性设置转移到相同颜色的下一个产品。

我遇到的问题是,即使一切看起来都正确,产品没有显示在产品列表中,直到我进入管理端,编辑产品,将可见性设置更改为隐藏,然后返回显示(以便它让我点击保存按钮,但页面加载时实际上没有任何变化),然后点击保存并按预期显示。

所以我一定在被查询的数据库中遗漏了一些东西,但我不知道是什么,posts 和 post_meta 表在管理端点击保存之前和之后看起来都一样。唯一更改的_edit_lock字段是 post_meta 表中的字段。

这是我为传输可见性设置而编写的脚本的一部分,我最初遇到了这个问题,发现这是因为该产品仍然标记为缺货,所以我最后添加了该行并且它似乎可以正常工作,但是现在有些东西否则导致它:

    ...
    // $child_id is the product that the visibility settings are being transferred to, it should at this point be hidden
    // $visibility is the settings of the product that was visibile


    // swap visibility settings of the products
    $child_visibility = get_post_meta($child_id,"_visibility",true);
    update_post_meta($product->get_id(),"_visibility",$child_visibility);
    update_post_meta($child_id,"_visibility",$visibility);


    // copy color taxonomies over in case they were not entered 
    // this saved time …
Run Code Online (Sandbox Code Playgroud)

php methods wordpress product woocommerce

2
推荐指数
1
解决办法
8251
查看次数

标签 统计

android ×1

deep-linking ×1

methods ×1

php ×1

product ×1

woocommerce ×1

wordpress ×1