In my Firebase iOS app, I have an endpoint pointing to users in the app called "users", inside this endpoint, the basic structure is as follows:
- users:
- userid-1:
- username: "test"
- email: "[email protected]"
- etc...
- userid-1:
The problem I faced now (it worked perfectly fine before) is that when I use observeEventType or observeSingleEvent and try to retrieve the snapshot.value in the path: "users/userid-#", it gives me null even though the data are shown on my dashboard at that location.
This case only happens for one of the userid's. I can successfully retrieve all other users' data. Since the data are actually shown on the dashboard, so I have no idea why when retrieving the data I got null instead of the data shown in that location.
The code I use is very simple:
Firebase *testRef = [self.ref childByAppendingPath:@"users/userid-1"];
[testRef observeSingleEventOfType:FEventTypeValue withBlock:^(FDataSnapshot *snapshot) {
NSLog(@"%@", snapshot.value);
}];
What I got is null instead of the data
Anyone have any ideas on what might have happened?
Thanks!