I'm currently using Firebase 11.2.0 and unable to create a short dynamic link successfully
My code to create the long link is:
val link = "https://example.com/param/id"
val dynamicLink = FirebaseDynamicLinks.getInstance().createDynamicLink()
.setLink(Uri.parse(link))
.setDynamicLinkDomain("v53sr.app.goo.gl")
.setAndroidParameters(DynamicLink.AndroidParameters.Builder("com.greelionsoft.mareas.espana")
.setMinimumVersion(22)
.build())
.buildDynamicLink()
This long link code can be shared via intent and works as expected but it's way too long.
Then the code to create shortlink:
FirebaseDynamicLinks.getInstance().createDynamicLink()
.setLongLink(dynamicLink.uri)
.buildShortDynamicLink()
.addOnCompleteListener { task ->
if (task.isSuccessful) {
val shortLink = task.result.shortLink
//handle shortlink
} else {
//handle error
Log.e("TAG", "Short Dynamic link error", task.exception)
}
}
Task is always unsuccessful and the following error is printed in logcat:
Dynamic link error 7: Forbidden
com.google.android.gms.common.api.ApiException: 7: Forbidden
at com.google.android.gms.common.api.internal.zzde.zza(Unknown Source)
at com.google.android.gms.internal.zzdzo.zza(Unknown Source)
at com.google.android.gms.internal.zzdzt.onTransact(Unknown Source)
at android.os.Binder.execTransact(Binder.java:565)
I haven't been able to find any clue about this "Error 7: Forbidden"
Has anybody encountered the same issue?
Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…