NotificationCenter.default.rx
.notification(custom: .gotFcmToken)
.subscribe(onNext: { (value) in
// do something
})
.disposed(by: bag)
extension Reactive where Base: NotificationCenter {
func notification(custom name: Noti, object: AnyObject? = nil) -> Observable<Notification> {
return notification(name.notificationName, object: object)
}
}