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

iOS Support #8

Open
point-source opened this issue Sep 30, 2022 · 6 comments
Open

iOS Support #8

point-source opened this issue Sep 30, 2022 · 6 comments

Comments

@point-source
Copy link

Hi! I'm the author of the dart_ping package and I noticed you have a warning on your readme that states that your package does not support iOS. I also recall you opened an issue on my package about this and we were running into the same tradeoff where we either have ios support and depend on flutter and lose native dart support or we lose ios support to preserve native dart.

I just wanted to chime in and say you can probably point your users towards my dart_ping_ios package since they should still be able to use this to enable your package on iOS without any changes to your package. They just need to import it and call the registration function. Granted, this will require the flutter sdk but at least then the choice is up to your users rather than you as an author.

Just a friendly heads up in case it helps. Let me know if you have any questions about how that works. :)

@ivirtex
Copy link
Owner

ivirtex commented Oct 1, 2022

Hi! Thanks for reaching out, I did some tests with your dart_ping_ios but I couldn't get it to work, my implementation uses isolates internally so it seems like this issue is the blocker: flutter/flutter#13937.

When handling background isolates merges into stable, I will update the documentation and point users to the dart_ping_ios.

Btw, did you see the new ObjC & Swift interop in Dart? It might be worth checking out, since it doesn't depend on platform channels and can be used without Flutter itself, we could make dart_ping work on iOS without any external packages.

@point-source
Copy link
Author

Where I got stuck last time was getting a pure dart package to include external binaries as an asset. Wouldn't that still be an issue here?

More details: point-source/dart_ping#6 (comment)

@ivirtex
Copy link
Owner

ivirtex commented Oct 3, 2022

Well, what binaries exactly would you like to include?
As far as I know, you can ping directly from Obj-C or Swift code like here: https://github.com/samiyr/SwiftyPing/blob/master/Sources/SwiftyPing/SwiftyPing.swift

Furthermore, I don't think you can execute yours own binaries from Dart code? It has not been possible for some time now.

@point-source
Copy link
Author

I think the real question that I was not able to answer for myself is:

If you have functionality that depends on non-dart code (whether raw swift or precompiled obj-c), how do you include that in a native dart library such that a user importing your dart library into a flutter app does not need to manually add or link the non-dart code?

I could not find a way for the native dart library to tell flutter to use a cocoapod or include a header file or a binary. All that functionality seems to be flutter or xcode specific.

@ivirtex
Copy link
Owner

ivirtex commented Aug 5, 2023

4.0.0 version includes a new function which internally doesn't use isolates, so it's now possible to use this package on iOS after calling register function in dart_ping_ios.

I added a relevant note in the readme pointing to your dart_ping_ios, thanks for coming up with this idea :)

@point-source
Copy link
Author

Hey, that's awesome news! Thanks 🙏

Let me know if there's anything else I can do to help :)

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

No branches or pull requests

2 participants