Reputation: 2708
What is wrong with the way in which I am making this call on a Firebase reference?
I keep getting error Ambiguous use of 'observeSingleEvent'
func updateFcmTokenOnChats(userID: String, fcmToken: String) {
let ref = DDatabaseRReference.users(uid: userID).reference().child("chatIds")
ref.observeSingleEvent(of: DataEventType.value) { (snapReceived) in
print("someCode")
}
}//end of updateFcmTokenOnChats
Here is an explanatory image of the error message:
Upvotes: 1
Views: 224
Reputation: 4166
You can try to solve the compiler confusion using:
ref.observeSingleEvent(of: DataEventType.value, with: { (snapReceived) in
...
})
Upvotes: 3