Hi ankimobile dev team:
I am a co-author of an ankimobile assist app named “ankiclip” which can be used to add note into ankimobile by one clicking in iOS app(like native BBC app)
To do this, we used ankimobile url schema. But currently our users have to manually type those fields in app setting
Is there anyway from ankimobile to add some url schema. So it can let us retrieve these info automatically, list it in drop down list, then users can select from list and never wrongly typed these fields name, for example:
Clipboard may be not such straightforward for user experience. Is it possible return a json string as x-success content if there is not so much info need carry
Here is x-callback-url usage by searching google(sorry, can’t include link here)
iOS
shortcuts
use-x-callback-url
To reduce disturbance of users, call x-callback-url only onetime and return a full set of profile data in single json string would be perfect, but if x-success can’t carry too much info, we at least can call 2 times to get note type, then get fields based on note type (usually user only have one default profile unless they specified). In this case we even do not need json. A comma separated note list or fields list string is enough.
Don’t know much about iOS development yet. Still learning. Anyway, thanks you implemented url schema when I suggested several years ago. At that time, I use it in iOS workflow(now it is shortcut). Now I think it’s time to develop an app to improve experience.
What do you mean? The calling app can send a message to AnkiMobile, which puts the data in the clipboard and then returns to the calling app. If it wants to keep the user’s clipboard, it can save it before calling AnkiMobile, and then restore it afterwards. That will allow us to pass a potentially large JSON message without worrying about having to divide it up into multiple back-and-forth calls.
AM will probably also need to get the user to confirm, since it’s a potential privacy violation otherwise.
sorry, maybe I did not make it clearer at very begining. I mean I want to use “x-success” feature of iOS x-callback-url to make 2 way communication.
say, my app named ‘ankiclip’. when I call ankimobile to get profile json string. I call it as
here I put x-success=ankiclip://callback/result? as one of your x-callback-url parameter. your app read the value of x-success, and attach json={your json string here} after it and call browser. so the url you called looks like ankiclip://callback/result?json={you json string here} . It will jump back to my app, so I can get the json string.
Some references for your information.
"Use x-callback-url " standard Apple doc. https://support.apple.com/en-hk/guide/shortcuts/apdcd7f20a6f/ios
I am proposing something similar, but instead of passing the data as a URL parameter in the success URL, it would place it on the clipboard then call the URL, which would avoid issues with payload length.
On iOS, every time it prompts for Open in Anki? and also it opens AnkiMobile. When cards added successfully it returns back. Also multiple notes are not possible to add. Images can be added but only from network not from local generated image. I have read about the URL schemes have those limitations and nothing can be done to reduce the friction.
I came to know about universal scheme but it only works for website owned by developer.
I have used genanki-js for generating decks inside browser and exporting .apkg file, which seems better.
But is any better way to create notes on iOS and adding notes directly to AnkiMobile?
May be it will be features request.
Option to add multiple notes
Option to add image/file from base64 with file name and type
Option to add model and card template if not exist
apkg files were never intended to be used by other programs. In the future it may make sense to create another format for import/export that is designed to be easy for other programs to use.