问题
Quite simple. 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. Is this possible in KaiOS?
Similar question to this stackoverflow question, but just the other side. Another application should be possible to link to my application.
回答1:
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
},
}
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.
来源:https://stackoverflow.com/questions/63368909/how-to-implement-deeplinks-in-kaios