-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
open card browser and search using deep links #11899
Conversation
Cool! Just a question, what happens if the link has the x-callback-url stuff / looks exactly the same as the iOS version from ankimobile docs? Just curious since true cross platform interop is such a superpower, it is worth some code to manage it if possible |
The In safari or chrome for iOS devices, following can be used. Also ankiUrlScheme = "anki://x-callback-url/addnote?profile=User%201&type=Basic&deck=Default&fldFront=front%20text&fldBack=back%20text"
document.location = ankiUrlScheme; For AnkiDroid,
Also in docs we have to mention that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks surprisingly easy / "works as documented", and though the feature (search here, vs add note etc on ios) varies from iOS it has compatible construction. This looks like a style with lots of future potential to me.
match ankimobile url scheme
Hey @dae if you have a minute, this is an ecosystem cross-compatibility thing. My hope is that all URLs will work on all platforms and I'd love it if you could confirm we're meeting that goal with our support here |
That looks like the syntax AnkiMobile uses, though please note it only supports adding notes at the moment, and does not support searching. Minor bikeshedding on the URL - how about this instead? anki://x-callback-url/browser?search=nid:1658178059263 |
But now that you're aware adding this we can stay in sync when/if you add searching :-). Good to hear we're on-target and I agree "search" is unambiguous enough while being shorter and reading better for non-developers |
I like the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
All of Damien's URL suggestions ingested now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM too. Awesome feature
The emulator tests are erroring with different errors but every time I look at them it's the system going out of memory, I'll see if I can tune that quickly, the false-negative rate is atrocious. Thanks for the restart |
Hi there @krmanik! This is the OpenCollective Notice for PRs merged from 2022-08-01 through 2022-08-31 If you are interested in compensation for this work, the process with details is here: https://github.com/ankidroid/Anki-Android/wiki/OpenCollective-Payment-Process#how-to-get-paid We only post one comment per person per month to avoid spamming you, regardless of the number of PRs merged, but this note applies to all PRs merged for this month Please note that GSoC contributions are okay for this process. Our philosophy is that our users have donated to AnkiDroid for all contributions. The only PRs that will not go through the OpenCollective process are ones directly related to am accepted GSoC project from a selected participant, since those receive a stipend from GSoC itself. Please understand that our monthly budget is never guaranteed to cover all claims - the cap on payments-per-person may be lower, but we try to make our process as fair and transparent as possible, we just need your understanding. Thanks! |
Pull Request template
Purpose / Description
Open card browser from another app with search query
Fixes
Fixes #11885
Approach
scheme="anki"
,host="x-callback-url"
andpath="/cardbrowser"
getQueryParameter
How Has This Been Tested?
Tested using chrome and https://krmanik.github.io/deeplinks-intent-test/
test
The webpage creates
a
tag and href value with above intenta) Searching nid
b) Searching
some text
Clicking on
Open action
will open the card browser withsearch
Also following can be used to test
a) Using adb
b) Using window.location
Learning (optional, can help others)
https://developer.android.com/training/app-links/deep-linking
https://developer.chrome.com/docs/multidevice/android/intents/
Links to blog posts, patterns, libraries or addons used to solve this problem
Checklist
Please, go through these checks before submitting the PR.
if
statements)