Reputation: 141
Firebase data observers in our iOS app stopped responding since couple of days. Works fine on simulator but hangs on the real devices.
Nothing in our app has changed since, and we're clueless as to what made Firebase behave this way.
Our usage well within the current plan quotas. We saw this issue for the whole of the last week of last month. Mysteriously, all started working normally since 1st of April, precisely for a week till yesterday.
Could anyone guide us through to resolve? We tried some workarounds from the community about the same issue e.g. disabling bitcode but they didn't work.
Upvotes: 1
Views: 387
Reputation: 141
Finally we got the issue resolved. It was related to auth token issue.
Saw more info about the actual issue by enabling logging in Firebase, through
FIRDatabase.setLoggingEnabled(true)
In the logs we saw messages:
Error fetching token: Error Domain=FIRAuthErrorDomain Code=17011 "There is no user record corresponding to this identifier. The user may have been deleted." UserInfo={NSLocalizedDescription=There is no user record corresponding to this identifier. The user may have been deleted., error_name=ERROR_USER_NOT_FOUND}
We were fetching some useful information ("/metadata/*") from Realtime Database before user logged (essentially auth is empty). Our database rules allow it:
{
"rules": {
"metadata": {
".read": true,
".write": false
}
".read": "auth != null",
".write": "auth != null"
}
Though our database rules allow that access, Firebase was bent on authToken, perhaps due to the default 'auth != null' rule protecting all the others.
We resolved the issue now by fetching even the metadata after the signIn, and everything is just fine.
Hope someone finds this useful.
Upvotes: 0
Reputation:
Does this happen to you after app update? - I'm having this kind of issue as well... in my case the completion block is not called. I'm writing answer because I don't have reputation to post as a comment.
Upvotes: 1