Hi all,
I’m running TW via Bob in Termux, so accessing it on localhost on Android.
Following the instructions in this post, I was able to make TW a PWA installed on my phone (so that I don’t even have to use Tiddloid).
I could not however figure out how to enable share_target
and shortcuts
, which are pretty essential to speed up my workflow on Android (for example to quickly add a webpage URL or a picture into a new tiddler, or to open an existing tiddler in the PWA from a shortcut button on my homescreen).
My $:/manifest.json
looks like this currently (I’ve hardcoded the URLs for now because I did not spend enough time figuring out a better way):
`{
"name": "`{{$:/SiteTitle}}`",
"short_name": "`{{$:/SiteTitle}}`",
"description": "tiddlywiki PWA de zig",
"theme_color": "#4682B4",
"background_color": "#4682B4",
"display": "standalone",
"orientation": "portrait",
"scope": "http://localhost:8005/",
"start_url": "http://localhost:8005",
"icons": [
{
"src": "`<<datauri "icon-192x192.png">>`",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "`<<datauri "icon-512x512.png">>`",
"sizes": "512x512",
"type": "image/png"
}
],
"share_target":
{
"action": "http://localhost:8005/",
"method": "GET",
"enctype": "application/x-www-form-urlencoded",
"params":
{
"action": "createtid",
"name": "NewNote",
"title": "title",
"text": "text",
"url": "url"
}
},
"shortcuts": [
{
"name": "Groceries",
"url": "http://localhost:8005/#Groceries",
"icons": [{
"src": "`<<datauri "icon-96x96.png">>`",
"sizes": "96x96",
"type": "image/png"
}]
}
]
}`
The PWA does not appear in the list of targets when sharing, or in the menu to add a shortcut to the homescreen.
I don’t know much (at all) about PWAs or JavaScript - not sure if a service worker is actually required for share_target or shortcuts?