Deeplinking

Yeah, and it would be great that we can click on URL scheme links from other apps in Anytype…
(ex. omnifocus:///task/oekxb28YaiQ) At the moment, it just opens a new object with the link as the title.

Not great…

2 Likes

After a bit of tinkering around, i discovered that deep-linking is already possible in a limited way:

  • it only works on MacOS
  • it survives a restart
  • No clue about what happens when moving the object
  • I found it only for Sets
  • It requires deep tinkering

If you wanna try it out. Here are the steps to build a link:

  • Open AnyType on MacOS
  • Select Debug → Dev Tools
  • Go to Sources → anytype → src → ts → lib → api → command.ts
  • Set a breakpoint inside of the declaration of const ObjectOpen
  • Click on a link to the desired Set
  • Now objectId should contain the Id of the Set

The URL will then look like this:

anytype://main/set/XXXYourIdXXX

Yes, super complicated to get the ID. Hope they add an option for it in the GUI

You can actually turn on Debug -> Flags -> Middleware to see middleware requests/responses and see ObjectOpen request from there or press Cmd/Ctrl + Shift + \ and see object id in a popup.

And deeplinks work not only for sets, they work for all routes, for example anytype://main/graph.

1 Like

Cool, thank you! Is there an overview what routes do exist?

Here is the list of all routes, auth is for auth pages, main for authorised. Most routes work as main/history/<object id> for example.

Thanks, but not gonna lie i dont understand much of what you guys are talking about. I’m able to get to my homepage with anytype://main/history even tho i dont understand what that means. I’d like to get a link for any of the objects in Anytype, what is the path to, for exemple a page that is in my homepage etc…

2 Likes

See PR Feature/JS-4019: Universal deeplink by ra3orblade · Pull Request #574 · anyproto/anytype-ts (github.com)