Fetching user's' address book local contacts and built-in customizable screen for sending invitations or adding as friend.
- Accessing address book contacts
- Service for safely fetching local address book contacts
- BuiltIn SwiftUI customizable Contacts Picker
- BuiltIn send text message
- Include your own custom user to the ContactPicker
- Enrich your custom users with address book matching data
- Include permission pre-prompt and reoptin
- Set custom CacheService to improve fetching performance
- Set custom UploadContactsService to sync the address book contacts to your backend
- Write sample with cache
- Social sharing
- Customizable SwiftUI sheet
- Copy to clipboard, by message, native sheet or to social networks
- Networks implemented: Instagram, WhatsApp, Telegram, Twitter, Messenger
- iOS 15.0+
- Xcode 12.0+
- Swift 5.5+
dependencies: [
.package(url: "https://github.com/macistador/ContactsKit", from: "0.0.1")
]BuiltIn SwiftUI View
let sections: [ContactsPickerSection<User>] = [.localContacts(title: "My Contacts",
actionKind: .sendMessage(title: "invite", body: "Hey buddy, join me to this cool app!"))]
ContactsPicker<User, EmptyView>(sections: sections) { contact, actionResult in
print("Contact tapped: \(contact)")
}Service only
do {
let contacts = try await contactsSerivce.fetchAllLocalContacts()
} catch {
print("An error occurred: \(error.localizedDescription)")
} let sharings: [Sharing] = [.clipboard(title: "Amazing title", symbol: "rocket", text: "amazing text"),
.social(app: .instagram("Amazing text", isURL: false))]
SharingView(sharing: sharings) { result in
switch result {
case .clipboard:
print("Content shared to clipboard")
case .social(let socialApp):
print("Content shared to \(socialApp)")
case .message(let isSent):
print("Message sent: \(isSent)")
case .other(let isShared):
print("Other: \(isShared)")
}
}For more details you may take a look at the sample project.
Meanwhile this library works well alone, it is meant to be complementary to the following app bootstrap packages suite:
- CoreKit: Foundation app requirements: Routing, State management, logging...
- BackendKit: Handling remote requests, authentication for Firebase / Supabase
- DesignKit: DesignSystem
- VisualKit: UI components (SwiftUI Views, ViewModifiers)
- MediasKit: Loading, caching & displaying Images, Videos, Audios
- CameraKit: Capturing photos, videos and audio with effects
- PermissionsKit: User permissions handling
- SocialKit: Share, invite friends
- CartoKit: Locate, display maps
- AnalyzeKit: Analytics
- IntelligenceKit: Integrate embedded AI models
- AdsKit: Displaying ads
- PayKit: Handling paywalls & inApps
SocialKit is developed and maintained by Michel-André Chirita. You can follow me on Twitter at @Macistador for updates.
SocialKit is released under the MIT license. See LICENSE for details.