Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
803 views
in Technique[技术] by (71.8m points)

android - Can't create short Firebase dynamic link -> Dynamic link error 7: Forbidden

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...