Alterplay / APAddressBook

Easy access to iOS address book
MIT License
1.38k stars 193 forks source link

Warnings on iOS 10 about ABAddress deprecations #138

Open gzfrancisco opened 7 years ago

gzfrancisco commented 7 years ago

We need change ABAddressBookRef to CNContactStore on many files.

Maybe I can do it, but I need to be sure there is no one on this or another issue about this.

In Xcode 8 and iOS 10 I have this messages:

screen shot 2016-09-20 at 12 41 23

Please tell me if you want I solve this and made a PR.

ghost commented 7 years ago

Same here, Any solution?

belkevich commented 7 years ago

Yes, we think it about. @gzfrancisco I'll research on Contacts API this weekend. And make up my mind about replace ABAddressBook with Contacts. And it would be great if you help.

kevinlieser commented 7 years ago

Something to think about: ABAddressBook has the record ID field. Contacts just has an UUID field. So it seems that there is no "connection" between this data. For example: I have an App which stores the record ID to set a status for that contact. When switching to Contacts Framework there is no record ID anymore. I am not able to "connect the data with the contact".

Another hint: WhatsApp API is using the record ID to directly open a message dialog with contact. UUID will not work until WhatsApp supports this.

iMessage Extension: The conversation work with the UUID of contacts – so it would be nice to have both.

Is there any way to get the UUID AND the record ID?

ctews commented 7 years ago

I would also really appreciate if you could convert to the Contacts APIs :) Warnings treated as errors makes life hard ;)

belkevich commented 7 years ago

@kevinlieser I don't think ABAddressBook and Contacts is fully compatible. But I'll try to keep as max APContact fields as possible. Also, I can leave old framework and add some flag to init like shouldUseDeprecatedAPI (that would be great for apps that support iOS < 9). So, you will be able to create 2 instances of APAddressBook and merge contacts data by yourself.

gzfrancisco commented 7 years ago

@belkevich Sure, it would be great. I'll be glad to help this weekend.

About the problem with RecordID and UUID, (I don't know yet) but it would be wonderful have 3 methods on the contact: recordID, uuid, and identifier. The last one is a facade for those methods, but I don't know if it's possible.

kevinlieser commented 7 years ago

@gzfrancisco

About the problem with RecordID and UUID, (I don't know yet) but it would be wonderful have 3 methods on the contact: recordID, uuid, and identifier. The last one is a facade for those methods, but I don't know if it's possible.

That would be very nice!

gzfrancisco commented 7 years ago

Oh my...

screen shot 2016-09-26 at 12 02 35

CoderKLTse commented 7 years ago

@belkevich I look forward to APAddressBook support Contact Group information.

qq20160928-0 2x qq20160928-1 2x
ctews commented 7 years ago

Any news if you want to convert it to the Contacts APIs?

gzfrancisco commented 7 years ago

I'm still working on this but it's hard. There are many reference to methods and the main thing is with the new Contacts framework is more like objects and values instead function with the old framework's version.

I just forked this repo and working there.

belkevich commented 7 years ago

Sorry guys. I've been too busy. I hope next weekend I'll do this

ghost commented 7 years ago

BUMP , Any updates guys

gzfrancisco commented 7 years ago

I've been busy. My project drop the iOS 9 support and I remove all the code. Sorry guys.

Luccifer commented 7 years ago

but we can evade warnings and save ios compability by [[NSProcessInfo processInfo] operatingSystemVersion beginnig from iOS8 no?

If anybody wanna just hide(not to resolve) warnings do this:

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

// YourCode

#pragma clang diagnostic pop
ismailismail commented 7 years ago

Any updates guys

mradzinski commented 7 years ago

+1, this it should be consider high priority

ymoussaba commented 7 years ago

+1, this is definitely a high priority

mrdavey commented 7 years ago

+1

ctews commented 7 years ago

Any news on this? It gets more and more urgent.

rvi commented 7 years ago

Same here. Can help if you guys want.

igrampe commented 7 years ago

+1

rmncv commented 7 years ago

+1

arpitdongre commented 7 years ago

+1

ctews commented 7 years ago

Any updates on that topic?

joshuapoq commented 7 years ago

APAddressBook is deprecated on iOS 10 - theres no need to use it anymore. The new Contacts stuff exposes everything you need.

Edit: Additionally, if you were storing and using RecordId, you shouldn't have been as there is no use linking your own contact to an contact on the device - as stated by the apple docs. In Contacts you can no longer get the old recordId, and you should not store the new identifiers.