feat(android): add JSON share intent for AI-assisted meal import - #587
Open
Marc4k wants to merge 2 commits into
Open
feat(android): add JSON share intent for AI-assisted meal import#587Marc4k wants to merge 2 commits into
Marc4k wants to merge 2 commits into
Conversation
Author
|
@simonoppowa, any updates on this one? I use it daily and would love to switch back to the main app instead of running my fork. Happy to also implement iOS support if that's a blocker for merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Android share intent support so any app — including AI assistants
using the bundled food-tracker skill — can share meal JSON directly to
OpenNutriTracker. The skill accepts natural-language descriptions and
food photos; it generates the app's existing JSON export format and the
user taps Share → OpenNutriTracker, confirms the import dialog, and the
meals land in their diary.
iOS share intent is out of scope for this PR (no Share Extension target
exists yet). The Flutter service returns null on iOS so there is no
regression — tracked as a follow-up.
Ai Skill
food-tracker.skill.zip
Type of change
Related issues
Changes
AndroidManifest.xmlregistersACTION_SENDintent-filtersfor
text/plainandapplication/jsonso the app appears in the systemshare sheet
MainActivity.ktcaptures the shared text via aMethodChanneland holds it until Flutter reads it (handles both cold-startand singleTop
onNewIntent)ShareIntentServicebridges the channel; returnsnulloniOS (no-op fallback)
MainScreenchecks for a pending share on cold start and onevery foreground resume via
AppLifecycleListener, shows a confirmationdialog, and imports approved meals using the existing
ImportMealsJsonUsecaseshareJsonImportContent,shareJsonImportErrorLabel) added to all 9 supported locales (EN + DE, CS,IT, PL, SK, TR, UK, ZH)
curly_braces_in_flow_control_structureslint inmeal_relevance_ranker.dartthat blocked CIScreenshots / recordings
example.mp4
Test plan
Steps
fvm flutter run --flavor develop)ONT's export format
Checklist
just format/ 120-char line width)Semantics(identifier: '...')whereneeded (
share-json-import-confirmon the dialog confirm button)lib/generated/when user-facingstrings change
just build) — no codegen changes.envvalues committedfeat:,fix:,chore:)