-
-
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
Intent/Activity API for opening the Card Browser #11885
Comments
I don't believe this is possible yet. Sounds like a great idea. Pull requests welcome! |
interesting, from the doc you linked "A little known feature..." indeed it is! I work with mobile apps and dynamic links from firebase a lot but did not know the chrome browser could do this. From their example they mention consulting the zxing AndroidManifest to see the scheme definition, it's here, and it appears you just need to define whatever scheme you want (e.g., <!-- Support zxing://scan/?... like iPhone app -->
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="zxing" android:host="scan" android:path="/"/>
</intent-filter> seems like we could define our "verbs" as hosts on whatever filters we want, make sure they are DEFAULT/BROWSABLE so they can open the app, that the filters are defined for the right activity in our app, and we pass in the parameters we need and it would work. As David said, PRs welcome, this would be interesting |
For reference, what AnkiMobile uses: https://docs.ankimobile.net/url-schemes.html |
looks like it doesn't support search, perhaps @dae has an opinion on what URL scheme he'd like to see for a note id search to open card browser? |
x-callback-url is an iOS thing, so it might not be practical to use the same scheme on both platforms. But I'd suggest using a generic search endpoint where the search string is passed in, rather than making something specific for note ids. |
Is your feature request related to a problem? Please describe.
At the moment, I have a website with my relevant anki notes to things like
nid:1238753945
. I have to select the text (which is rather painful on mobile) and click "Card Browser" in the context menu to go to it.Describe the solution you'd like
An intent API for navigating to the Card Browser with an action parameter filled in as the search query.
Since you can deep-link to intents with a specially crafted hyperlinks in web apps, this would make the experience much nicer. I could make the
nid:1238753945
text a hyperlink that automatically opens AnkiDroid to the right note when tapped.Describe alternatives you've considered
Since it's not possible to use the native API from a website, I tried to see if context menu intents can already be triggered from a hyperlink. Unfortunately, I'm not very experienced in android development and couldn't figure out how to craft that intent hyperlink by looking at the
AndroidManifest.xml
.If it's already possible, that would be great! If not, I'm hoping it would just be a small change to the way the intent is exported.
The text was updated successfully, but these errors were encountered: