Monday, 8 November 2021

Android: Get HTTP error code 429 when Firebase Dynamic Link generation limit exceeds

I am generating Firebase Dynamic Links from Android app. There is a case that I want to handle specifically. Firebase allows 200000 requests per day per project. The Firebase documentation says that you will get error code 429 when this happens but I am unable to see anything in the failure callback to capture this code. My code snippet:

Firebase.dynamicLinks.shortLinkAsync(ShortDynamicLink.Suffix.SHORT) {
                link = Uri.parse(buildInvitationLink(config))
                domainUriPrefix = getDomainPrefix(config)
                setAndroidParameters(buildAndroidParameters(config))
                setIosParameters(buildIosParameters(config))
            }.addOnSuccessListener { task ->
                val shortLink = task?.shortLink.toString()
                shareInvitationLink(shortLink)
            }.addOnFailureListener {
                // handle 429 limit exceeds error gracefully here
            }

What can I do to detect this limit breach?



from Android: Get HTTP error code 429 when Firebase Dynamic Link generation limit exceeds

No comments:

Post a Comment