代号一 android 拦截网址问题

codename one android intercepting urls issue

我在拦截代号为 android 的网址时遇到问题。我使用构建提示 ios.urlScheme 和 ios.plistInject 让它在 ios 上运行良好。我用于 android 的构建提示是:

android.xintent_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="mibrand" />  </intent-filter> 

但是 android 没有将文本 "mibrand://..." 注册为 link,因此它只是纯文本,无法在任何 android 设备上点击。我做错了什么?

这是我的 php 代码

<?php

$store = $_GET['ref'];
$id = $_GET['id'];
$link1 = "mibrand://";
$link1 .= $store;
$link1 .= "/";
$link1 .= $id;
$link2 = "http://www.mibrandapp.com";
?>

<a href="<?php echo $link2 ?>"></a>
<a href="<?php echo $link1 ?>"></a>

然后我设置 link 分享到 mylink/share.php?ref=store&id=56

它也不适用于 ios

您需要将其放入 html 页面并自行添加 link 然后将该页面分享给您的用户

<html>
...
<a href='mibrand://...'> open my app </a>
...
</html>

我刚刚使用 http://codenameone.com/testm.html 验证了这有效:

<html>
    <head>
        <title>Mibrand Test</title>
    </head>
    <body>
            <a href="mibrand://launch"> open my app </a>
    </body>
</html>

并且我使用了如上所述的构建提示,它映射到 codenameone_settings.properties 为:

codename1.arg.android.xintent_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\="mibrand" />  </intent-filter>

如果您需要它从电子邮件工作,只需重定向到 HTML,其中包含重定向到 link.

的 JavaScript 代码