-
Notifications
You must be signed in to change notification settings - Fork 1
Contacts Store
Stanislav Osipov edited this page Nov 7, 2020
·
4 revisions
The ISN_CNContactStore class is a thread-safe class that can fetch and save contacts, groups, and containers.
You may fetch all the contacts from user contact book with the FetchPhoneContacts of the ISN_CNContactStore class.
using SA.iOS.Contacts
...
ISN_CNContactStore.FetchPhoneContacts((result) => {
if(result.IsSucceeded) {
foreach(var contact in result.Contacts) {
Debug.Log(contact.GivenName);
}
} else {
Debug.Log("Error: " + result.Error.Message);
}
});When fetching contacts you may choose if you would also like to request the CNContactNoteKey key. To do so, pass includeNotes parameter as true. The default value is false.
using SA.iOS.Contacts
...
var includeNotes = true;
ISN_CNContactStore.FetchPhoneContacts((result) => {
if(result.IsSucceeded) {
foreach(var contact in result.Contacts) {
Debug.Log(contact.GivenName);
}
} else {
Debug.Log("Error: " + result.Error.Message);
}
}, includeNotes); Since IOS 13 to be able to fetch the note property in iOS, your app needs the com.apple.developer.contacts.notes entitlement. Special thx to @chris-o3h for pointing that out.
Reliable and high-quality Unity Development service. Let's Talk!
Website | AssetStore | LinkedIn | Youtube | Scripting Reference
- Getting Started
- Authentication
- Game Center UI
- Leaderboards
- Default Leaderboard
- Achievements
- Saving A Game
- Access Point
- iTunes Connect Setup
- StoreKit Initialization
- Purchase flow
- Receipt Validation
- Store Review Controller
- Storefront API
- Subscription Offers