s0nerik / fast_contacts

A faster way of accessing device's contacts list in Flutter
MIT License
15 stars 16 forks source link

[Feature] Add macos support #16

Open dkbast opened 11 months ago

dkbast commented 11 months ago

From my understanding, contacts is available on mac (and various other apple OSes) - I believe it would be great if we could also support macos - I suspect that this should be possible using the shared implementations "darwin" flag, that would require a minimum version of Flutter 3.7, so might be a "major" version increment for fast_contacts, or copy pasting the code into macos? I tried getting darwin to work, but the mix of "todays" Flutter and the ios implementation was too much for a quick 15 minute tinkering session.

If you can point me in the right direction I would love to assist :)

https://developer.apple.com/documentation/contacts

s0nerik commented 11 months ago

This should be quite easy. I'll look into it when I have some spare time. Increasing the minimum flutter version for a next plug-in version should not be a problem as well.

dkbast commented 11 months ago

I actually managed to get it to work on a mac only spike - two might be issues: permission handler does not support mac yet (PR seems to be open), so I had to bale that in and there are different imports for mac and ios needed - not sure how to solve that yet - but should be doable. Will push my proof of concept soonish

dkbast commented 11 months ago

@s0nerik - this is my "working poc" for a mac implementation - only minor changes, mostly copy paste from ios: https://github.com/dkbast/fast_contacts_mac

An implementation without its own permission handling would depend on https://github.com/Baseflow/flutter-permission-handler/pull/1207 to land

s0nerik commented 2 months ago

Thanks for your effort, I'll look into this soon and add the support if that's not too time-consuming.

amrgetment commented 2 months ago

I am interested in macOS support

@dkbast I overridden the permission handler and I added the permission setup in https://github.com/dkbast/fast_contacts_mac/pull/1

@s0nerik this is the testing result, it works only when I run from Xcode not vscode

https://github.com/user-attachments/assets/2e049587-f3dc-432a-b477-b7f4a6f98974

amrgetment commented 2 months ago

@dkbast Any idea why it works from Xcode but not from Vscode in Vscode it returns always permission denied permanently while it works fine from Xcode!!