Taken you're using Firebase for authentication, I presume you're using either Real Time Database or Cloud Firestore to store user data as well.
In your user data model, you can add user types.
For example,
user_type : "driver"
Then query users like so:
DBreference.collection("users").whereField("user_type", isEqualTo: "driver").getDocuments() {(querySnapshot, error) in
if error != nil { print(error.debugDescription)
return
}
else if let users = querySnapshot.documents {
for user in users {
guard let userType = user.data()["user_type"] as? String else { return }
print(userType)
}
}
}
This way you don't have to create multiple Facebook apps. Just use the one you have and segment users and their priviliges accordingly.
For example, upon login on both apps, do a check, whether the is user trying to log in as a driver or a passenger.
if currentUser.userType != "passenger" {
print("You can't log into the passanger app with your driver's account.")
}
Hope this helps.