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 new features and fix bugs on Android and iOS. #59

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

leechupe
Copy link

Bug:
Android Side:
Due to the Android framework version, some environment values have to be modified:

  1. Remove the package tag in AndroidManifest.xml.
  2. Set the service name to an absolute path in AndroidManifest.xml.
  3. Change the application name to the applicationName reference in AndroidManifest.xml.
  4. Upgrade com.android.tools.build:gradle version to 8.1.3
  5. Change the minSdkVersion to the flutter.minSdkVersion reference.

IOS Side:

  1. Add a _mp-connection._udp value to the field of the Bonjour service array in info.plist for fixing the NSNetServicesErrorCode = "-72008".

Flutter Side:

  1. Modify the serviceType from 'mpconn' to 'mp-connection' to address the problems IOS devices can't find.

New Features:

  1. Add a new feature for sending files.
  2. Add camera access requirement and the Image_picker lib for display file transfer feature.

Android Side:

  1. Add a new function to send a file by Payload.fromFile().

IOS Side:

  1. Add a new methodChannel and function to send a file by FlutterStandardTypedData type.
  2. Add the camera access requirement to the info.plist.

Flutter Side:

  1. Add a new button to the AlertDialog to send a file by the camera.
  2. Check whether the data is a file or string in the dataReceivedSubscription function.

Android Side:
1.Remove the package tag in AndroidManifest.xml.
2.Set the service name to an absolute path in AndroidManifest.xml.
3.Change application name to the applicationName reference in AndroidManifest.xml.
4.Upgrade com.android.tools.build:gradle version to 8.1.3
5.Change the minSdkVersion to the flutter.minSdkVersion reference.
6.Add a new function to send a file by Payload.fromFile().
Flutter Side:
1.Add a new button to the AlertDialog to send a file by the camera.
2.Check whether the data is a file or string in the dataReceivedSubscription function.
3.Add the image_picker lib for the file.
IOS side:
1.Add a _mp-connection._udp value to the field of the Bonjour service array in info.plist for fixing the NSNetServicesErrorCode = "-72008".
2.Add a new methodChannel and function to send a file by FlutterStandardTypedData type.
3.Add the camera access requirement to the info.plist.

Flutter side:
1.Modify the serviceType from 'mpconn' to 'mp-connection' to address the problems IOS devices can't find.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is not better to make that in flutter just implemence one time

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi B-O-B-G-I-T:
Thanks for your review.
But I don't understand. Could you elaborate more?
Thank you.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To send the photos you developed two functions in iOS and Android, I think you can do it in dart, simpler in maintainability I think. I don't remember exactly how you got it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi B-O-B-G-I-T:
Thanks for your feedback.
The original version only provided that send String function.
I made those functions not only sending pictures but also sending files.
It could not send files on the dart side because you have to send files using the native SDK.
If I have any misunderstanding, please feel free to tell me.
Thank you.

Flutter side:
1.Add a new methodChannel function named stop_all_endpoints for any needed situation stopping all endpoints.
@leechupe
Copy link
Author

Dear All:
I got a device-connected status problem when I used it on my project.
I found the problem is that the devices didn't stop.
So I added a new methodChannel function named stop_all_endpoints for any needed situation stopping all endpoints.
The original version only used it in the OnDestory function.
I hope it will be helpful.
Thank you.

leechupe added 2 commits May 16, 2024 18:20
Android side:
1.Add a new methodChannel function named stop_all_endpoints for any needed situation stopping all endpoints.
IOS side:
1.Remove stopAllEndpoints methodChannel code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants