[go: nahoru, domu]

Skip to content
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

Add tutorial on sharing data between Android/iOS and embedded Flutter #9363

Open
2 tasks done
eseidel opened this issue Sep 6, 2023 · 10 comments
Open
2 tasks done

Add tutorial on sharing data between Android/iOS and embedded Flutter #9363

eseidel opened this issue Sep 6, 2023 · 10 comments
Assignees
Labels
a.tut.tutorial Relates to the Tutorial section of docs.flutter.dev e2-days Effort: < 5 days from.flutter-sdk Reported via move from flutter/flutter p2-medium Necessary but not urgent concern. Resolve when possible. st.triage.ltw Indicates Lead Tech Writer has triaged t.add-to-app Relates to adding Flutter components to native app

Comments

@eseidel
Copy link
eseidel commented Sep 6, 2023

Is there an existing issue for this?

Use case

Users often come to us (Shorebird) and previously me in my role as Flutter director, confused as to how to share data between their add-to-app Flutter and their existing app.

Proposal

There appears to be an old example on this, "books":
https://github.com/flutter/samples/tree/master_archived/add_to_app

But I don't see something similar in the modern examples:
https://github.com/flutter/samples/

There is a whole guide on adding a little Android to your Flutter:
https://docs.flutter.dev/platform-integration/platform-channels

But there is no mention of going the other way. Even in the add-to-app tutorial:
The closest we get is:
https://docs.flutter.dev/add-to-app/android/plugin-setup

The basic question is "I have some data in my Android app, I'm adding a Flutter screen, how do I share data with that screen". Given that all of the top most used Flutter apps are add-to-app (or were last I knew) this feels worth documenting. :)

Then again, given the presence of the (archived) "books" sample, maybe I'm just looking in the wrong place?

FYI @RedBrogdon

Thank you!

@eseidel
Copy link
Author
eseidel commented Sep 6, 2023

There are various third parties who have tried:
https://blog.devgenius.io/use-flutter-screens-in-native-android-app-share-data-among-them-d97d670807a6
https://tanya-anand.medium.com/data-pass-between-flutter-and-android-using-the-method-channel-f0e8f7655fe

Even just picking one and linking to it, would probably be worth it, given that (at least in my experience) (especially "late majority") users tend to expect things from the official sources. 🤷

@mohit9923
Copy link

So the problem is:

Here, it is asking me to open Android folder inside the Flutter app, whereas my use case is to perform these android specific data-sending changes in my own existing native Android app, from where I am opening Flutter project on a button click
image

@huycozy
Copy link
Member
huycozy commented Sep 7, 2023

Hi @eseidel
I see the books sample here at https://github.com/flutter/samples/tree/main/add_to_app/books (not archived url) and I also can't find an existing tutorial/guideline for this on website.

But I wonder if this should be transferred to website repository? (as in the end, the tutorial will be published to the website and the team there will take care of this)

@eseidel
Copy link
Author
eseidel commented Sep 7, 2023

Please feel free to transfer wherever is appropriate. I recall we used to keep all bugs in one single repo, but please use whatever the modern patterns are. :)

@huycozy
Copy link
Member
huycozy commented Sep 8, 2023

Thanks for the response. Transferring this issue to website repo.

@huycozy huycozy transferred this issue from flutter/flutter Sep 8, 2023
@atsansone atsansone added the from.flutter-sdk Reported via move from flutter/flutter label Sep 8, 2023
@atsansone atsansone changed the title Would like a tutorial on sharing data between Android/iOS and embedded Flutter Add tutorial on sharing data between Android/iOS and embedded Flutter Sep 8, 2023
@atsansone atsansone added a.tut.tutorial Relates to the Tutorial section of docs.flutter.dev p2-medium Necessary but not urgent concern. Resolve when possible. e2-days Effort: < 5 days st.triage.ltw Indicates Lead Tech Writer has triaged t.add-to-app Relates to adding Flutter components to native app labels Sep 8, 2023
@atsansone
Copy link
Contributor

@leighajarett : Do we have anything in the pipeline for this?

@leighajarett
Copy link
Contributor

I don't specifically but I'm sure we can adapt the app extension stuff because its a similar mechanism https://docs.flutter.dev/platform-integration/ios/app-extensions

@eseidel
Copy link
Author
eseidel commented Sep 11, 2023

Thanks for the consideration. My interest here is simply in aligning what is documented with the frequency of the user journey. From my experience (at least since leaving Google) most customers are adding a little Flutter to some existing app, the fact that that "golden path" (at least the data sharing portion) isn't documented was surprising/concerning. (We actually commonly get outreach from customers who are considering moving their native app to Flutter now that code push is a possibility.)

Obviously you should validate with your own experience/numbers, it's possible the subset of customers we talk to at Shorebird is different from those the Google team is in contact with. 🤷

@leighajarett
Copy link
Contributor

Yeah totally. Thanks for the feedback, @eseidel!

Happy to help you with this, @atsansone. But I don't think I have the bandwidth to write myself in the next few weeks

@atsansone
Copy link
Contributor

@leighajarett : I'll set up a meet soon. Thanks!

@atsansone atsansone self-assigned this Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a.tut.tutorial Relates to the Tutorial section of docs.flutter.dev e2-days Effort: < 5 days from.flutter-sdk Reported via move from flutter/flutter p2-medium Necessary but not urgent concern. Resolve when possible. st.triage.ltw Indicates Lead Tech Writer has triaged t.add-to-app Relates to adding Flutter components to native app
Projects
None yet
Development

No branches or pull requests

5 participants