- iOS 12.0+
- Xcode 10.2+
- Swift 4.0+
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
Userbase is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'Userbase'
Then, run the following command:
$ pod install
The Userbase iOS SDK is meant to be used in conjunction with Userbase-Backend. Follow instructions here to setup your Firebase account and deploy the pre-written cloud functions. Make note of the url the functions are deployed to and add it to a new file called Userbase-Info.plist.
import Userbase
Initialize the Userbase SDK:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
Userbase.initWithLaunchOptions(launchOptions: launchOptions)
return true
}
The API is as follows:
Userbase.registerUser(id: String, password: String, firstName: String, lastName: String, developerMetadata: String, completion: @escaping (User?, Error?) -> Void)
Userbase.login(id: String, password: String, completion: @escaping (User?, Error?) -> Void)
Userbase.getFriends(completion: @escaping ([Friend]?, Error?) -> Void)
Userbase.sendFriendRequest(to id: String, completion: @escaping (Error?) -> Void)
Userbase.acceptFriendRequest(from id: String, completion: @escaping (Friend?, Error?) -> Void)
Userbase.getFriendRequests(completion: @escaping ([FriendRequest]?, Error?) -> Void)
Userbase.searchUsers(searchPrefix: String, completion: @escaping ([Friend]?, Error?) -> Void)
Userbase.logout(completion: @escaping (Error?) -> Void)
nikhil-kulkarni, [email protected]
Userbase is available under the MIT license. See the LICENSE file for more info.