I quickly put this together and is untested. Mac/iOS code.
Note that Simple Login is depreciated so this assumes the current API is installed.
The idea here is that when a user is created in Firebase, it's also created in your app space, in a users node. This is a common technique in Firebase.
The user is stored in your app node as a key/value pair with the value being a dictionary of email and password.
When your app starts, it loads in all of the users in the app->users node and then iterates over those to get the users info (email & pw)
The user is removed from Firebase and then also removed from the users node.
Firebase *usersNode = [mainAppNode childByAppendingPath:userNodeString];
[usersNode observeSingleEventOfType:FEventTypeValue withBlock:^(FDataSnapshot *snapshot) {
//iterate through the users loaded in via the snapshot
for ( FDataSnapshot *child in snapshot.children) {
NSDictionary *dict = child.value;
NSString *uid = child.key; //need this to remove the user from the apps users node
NSString *email = [dict objectForKey:@"email"];
NSString *pw = [dict objectForKey:@"password"];
//remove the firebase user
[mainAppNode removeUser:email password:pw withCompletionBlock:^(NSError *error) {
if ( error ) {
NSLog(@"Could not delete user from firebase");
} else {
//get a ref to this users node
Firebase *userToRemoveRef = [usersNode childByAppendingPath:uid];
[userToRemoveRef removeValue]; //remove the user info from the app
}
}];
}
}];