How to catch a Firebase Auth specific exceptions

前端 未结 16 2361
慢半拍i
慢半拍i 2020-11-28 04:37

Using Firebase, how do I catch a specific exception and tell the user gracefully about it? E.g :

FirebaseAuthInvalidCredentialsException: The email ad

16条回答
  •  孤街浪徒
    2020-11-28 05:10

    If you are sending upstream messages from user to cloud, implement firebase callback functions onMessageSent and onSendError to check the status of upstream messages. In error cases, onSendError returns a SendException with an error code.

    For example, if the client attempts to send more messages after the 20-message limit is reached, it returns SendException#ERROR_TOO_MANY_MESSAGES.

提交回复
热议问题