RxFirebaseAuth
RxSwift 和 Firebase Authentication 的组合
用法
Auth.auth().rx.addStateDidChangeListener()
.subscribe(onSuccess: { (auth, user) in
// ...
})
.disposed(by: disposeBag)
Auth.auth().rx.signInAnonymously()
.flatMap { UserModel.create(uid: $0.uid) }
.subscribe(onSuccess: { user in
// ...
})
.disposed(by: disposeBag)
依赖关系
- RxSwift 5.x
- Firebase Auth 6.x
安装
CocoaPods
CocoaPods 1.4 或更高版本 需要。
RxFirebaseAuth 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中
# Firebase 6.x
pod 'RxFirebaseAuth', '~> 2.4'
# Firebase 5.x
pod 'RxFirebaseAuth', '~> 2.3'
# Firebase 4.x
pod 'RxFirebaseAuth', '~> 1.0'
并运行 pod install
手动安装
下载所有 *.swift
文件并将其放置您的项目文件中。
开发
$ bundle install --path vendor/bundle
$ bundle exec pod install
$ open komerco.xcworkspace
通讯
- 如果您发现了错误,请提出一个问题。
- 如果您有功能请求,请提出一个问题。
- 如果您想贡献,请提交拉取请求。
💪
许可
RxFirebaseAuth 采用 MIT 许可。有关更多信息,请参阅LICENSE 文件。