如何在KaiOS中实现深层链接 [英] How to implement deeplinks in KaiOS
问题描述
用户应该能够点击诸如 app:this/is/some/link?with = information
之类的链接,然后所需的应用就会打开并执行某些操作.
A user should be able to click on a link like app:this/is/some/link?with=information
and the desired app opens and does some action.
这个问题是相似的,但只是另一面 KaiOS-使用WhatsApp共享.另一个应用程序应链接到我的应用程序.
This question is similar but just the other side to KaiOS - Share using WhatsApp. Another application should link to my application.
在KaiOS中有可能吗?
Is this possible in KaiOS?
推荐答案
深层链接确实存在于KaiOS 2.5.3或更高版本上,但是没有相关文档.例如,这来自KaiStore应用清单:
Deeplinks do exist on KaiOS 2.5.3 or newer, but there is no documentation on them. For example, this is from the KaiStore app manifest:
"deeplinks": {
"regex": "^(app://)(kaios-store|kaios-plus)(.kaiostech.com)($|/$|/\\?(apps|postResult)=)",
"action": "open-deeplink"
},
"activities": {
"open-deeplink": {
"href": "./index.html",
"disposition": "window",
"filters": {
"type": "url",
"url": {
"required": true,
"pattern": "(app|rtsp|data):.{1,16384}"
}
},
"returnValue": true
},
}
深层链接下的 action
指向 activity
中的一个,该活动必须接受必需的URL参数.然后,应用可以使用 navigator.mozSetMessageHandler注册
来处理此活动(请参见B2G的网络活动API ).
The action
under deeplinks
points to one of the activities
, which must accept a required URL parameter. An app can then register using navigator.mozSetMessageHandler
to handle this activity (see B2G's Web Activities API).
也就是说,无法深度链接到任意应用程序.应用必须按顺序在清单中公开网络活动可供其他应用打开.
That said, there is no way to deep-link to arbitrary apps. Apps must expose Web Activities in their manifest in order to be open-able by other apps.
这篇关于如何在KaiOS中实现深层链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!