How to check if user has valid Auth Session Firebase iOS?

前端 未结 7 2243
生来不讨喜
生来不讨喜 2021-02-19 04:53

I wanna check if the user has still a valid session, before I present the Home View controller of my app. I use the latest Firebase API. I think if I use the legacy, I\'ll be ab

7条回答
  •  情歌与酒
    2021-02-19 05:55

    An objective-c solution would be (iOS 11.4):

    [FIRAuth.auth addAuthStateDidChangeListener:^(FIRAuth * _Nonnull auth, FIRUser * _Nullable user) {
        if (user != nil) {
            // your logic
        }
    }];
    

提交回复
热议问题