-1

I deleted users in Firebase Console but the "welcomeController" is not showing as It should be , I read something needs to be done with firebase tokens but I am not sure what should I do. If someone has the solution I will be grafetul.

Currently I am using in didFinishLaunchingWithOptions:

if Auth.auth().currentUser?.uid == nil {

self.window?.rootViewController = EntryController()

} else {

self.window?.rootViewController = MainTabBarController()

 }

When I delete the user in the console rootView should be EntryController but it is not showing.

1 Answers1

0

When you execute the deleteUser function, once u get the success message from server make sure you are setting currentUser.uid to nil.

As of now When didFinishLaunchingWithOptions is called it still points to "MainTabBarController()" as the uid of the deleted user still exists in the app instance.

EDITED: Hope this helps.

How to log out user from app when I delete his account on firebase?

Cedan Misquith
  • 1,134
  • 9
  • 20
  • Thank you for the answer , can you please put the code – Petar Ivic Nov 26 '18 at 18:47
  • @PetarIvic I have edited my answer please check. Hope it gives you a better idea on how to approach your problem. – Cedan Misquith Nov 26 '18 at 19:14
  • I assume you did not understand what I wanted , I created users on the Firebase Console (Authorization) and in the app I do not have the option to delete the user I want to do that as admin in the app , what I mean is when I delete user in the console (Authorization) my UI stays the same , what I am trying to approach is when the user deleted is I want my UI changes but thank you anyway – Petar Ivic Nov 26 '18 at 19:25
  • @PetarIvic got it ... check this out https://stackoverflow.com/questions/43812875/how-to-log-out-user-from-app-when-i-delete-his-account-on-firebase – Cedan Misquith Nov 26 '18 at 19:26
  • Thank you very much I will try to find a solution – Petar Ivic Nov 26 '18 at 20:36