Firebase-ios-sdk: addStateDidChangeListener doesn't trigger when user.link success

Created on 8 Sep 2017  路  2Comments  路  Source: firebase/firebase-ios-sdk

Hi, how can I be notified when user link his anonymous account successfully with a new one?

addStateDidChangeListener stays silent 馃槄

auth question

Most helpful comment

@adamsmaka The listeners added by addAuthStateDidChangeListener: is by design only triggered when the current user changes. On the other hand, listeners added by addIDTokenDidChangeListener: would have be trigger when the ID token changes, including the linking account case, but our code currently has a bug in this case. I have filed #249 to track it. So at this moment the only thing you can do is to add code directly to the completion block of linkWithCredential:completion: or linkAndRetrieveDataWithCredential:completion:.

Also, just in case you weren't already aware, all listeners are triggered by local events only. Even after #249 is fixed, user linking account on one device won't directly trigger a listener in another app running on the same device, or a listener in any app running on another device.

All 2 comments

@adamsmaka The listeners added by addAuthStateDidChangeListener: is by design only triggered when the current user changes. On the other hand, listeners added by addIDTokenDidChangeListener: would have be trigger when the ID token changes, including the linking account case, but our code currently has a bug in this case. I have filed #249 to track it. So at this moment the only thing you can do is to add code directly to the completion block of linkWithCredential:completion: or linkAndRetrieveDataWithCredential:completion:.

Also, just in case you weren't already aware, all listeners are triggered by local events only. Even after #249 is fixed, user linking account on one device won't directly trigger a listener in another app running on the same device, or a listener in any app running on another device.

thank you so much for the answer. appreciate it. we can close the topic.

btw: I <3 Firebase

Was this page helpful?
0 / 5 - 0 ratings