Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [[FIRAuth auth] signInWithEmail:emailTxt.text
- password:pwdStr
- completion:^(FIRUser *user, NSError *error) {
- // ...
- NSLog(@"User: %@nUserEmail:%@nError:%@",user.uid,user.email,error);
- NSLog(user.isEmailVerified ? @"Verified = Yes" : @"Verified = No");
- [[NSUserDefaults standardUserDefaults] setObject:user.uid forKey:@"userid"];
- if(error == nil){
- if (user.isEmailVerified) {
- self.ref = [[FIRDatabase database] reference];
- NSString *userID = [FIRAuth auth].currentUser.uid;
- [[_ref child:[NSString stringWithFormat:@"users/user/%@",userID]] observeSingleEventOfType:FIRDataEventTypeValue withBlock:^(FIRDataSnapshot * _Nonnull snapshot) {
- // Get user value
- NSLog(@"%@",snapshot.value);
- // ...
- } withCancelBlock:^(NSError * _Nonnull error) {
- NSLog(@"%@", error.localizedDescription);
- }];
- }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement