1

I need help to get the URL which I create from the firebase Dynamic Link dashboard. I searched for just 2 days and I can't find anything. Here is a picture that I want to mentioned.

I created the deep link from the dashboard and then I wrote something like below. I want to get the url which I circled in the pictured.

FirebaseDynamicLinks.getInstance()
                .getDynamicLink(getIntent())
                .addOnSuccessListener(this, new OnSuccessListener<PendingDynamicLinkData>() {
                    @Override
                    public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) {
                        // Get deep link from result (may be null if no link is found)
                        Uri deepLink = null;
                        if (pendingDynamicLinkData != null) {
                            deepLink = pendingDynamicLinkData.getLink();
                            Log.e("SplashActivity", "deepLink " + deepLink);
                          //  Log.e("SplashActivity", pendingDynamicLinkData.zzbyk().getString("Url"));
                        }
                    }
                })

                .addOnCompleteListener( this, new OnCompleteListener<PendingDynamicLinkData>() {
                    @Override
                    public void onComplete(@NonNull Task<PendingDynamicLinkData> task) {
                        if (task.getResult() != null)
                            Log.e("SplashActivity", " task ");
                    }
                })

                .addOnFailureListener(this, new OnFailureListener() {
                    @Override
                    public void onFailure(@NonNull Exception e) {
                        Log.e("Splash", "getDynamicLink:onFailure", e);
                    }
                });

With the above code, I can just catch the deep link. Any suggest?

Olcay Sönmez
  • 602
  • 1
  • 7
  • 16
  • Please check messages on top of debug page for your link https://ysep8.app.goo.gl/HuKx?d=1 Ensure you configured your iOS and Android Apps according to Firebase Dynamic Link documentation. Feel free to open Firebase Support ticket or comment here if you need help. – Oleksiy Ivanov Oct 16 '17 at 20:00
  • Thanks for your response. I configured in firebase dynamic link dashboard for IOS and Android. It works but I need to get the short link. In our IOS app we can get it with webpage URL in IOS. It returns the short link. But I don't know why can't get the short link which is defined already in Firebase Dynamic Link console. Is it just the only way that we have to create all the dynamic link programmatically in android. The link which you send to me I looked at it. In my debug page It seems that the architecture is different between And and IOS and I think it's normal. @OleksiyIvanov – Olcay Sönmez Oct 17 '17 at 10:45
  • Hi @OlcaySönmez . How did you solve this. i am facing same problem. i am not able to get full URL. Please tell – Deepak Rathore Feb 11 '20 at 12:04

1 Answers1

1

Example of debug page for a link that includes iOS App information https://test3p.app.goo.gl/?link=http://www.google.com&isi=585027354&ibi=com.google.AppInvitesSample.dev&d=1 When you configured your link with iOS parameters you should see something similar. If you add Android parameters, you will see Android branch expanded as well.

When creating Firebase Dynamic Link ensure you filled sections "Define link behavior for iOS" and "Define link behavior for Android". For your link https://ysep8.app.goo.gl/HuKx it looks that you left those sections unfilled.

Example of section "Define link behavior for iOS": Example of section "Define link behavior for iOS"

Oleksiy Ivanov
  • 2,454
  • 15
  • 21
  • 1
    thanks again for your response.I already do this in the console and I prepared already my short links. what I am asking is when anyone clicks on the link it will open the app if it exists.if it doesn't exist then will redirect to the store. My question is when it opens the app by the link then I want to catch the shortlink by FirebaseDynamicLinks.getInstance().getDynamicLink(getIntent()).. but when the app comes up and calles the method which I wrote above , I can catch only the fallback Url not the short url. I am really glad to have the conversation with you it helps me correcting my links. – Olcay Sönmez Oct 18 '17 at 12:56
  • Hmm, why you need short link in your App? Normally App is interested in deepLink. FDL short link is just a way how deepLink is delivered to your App. Is this answer helps? https://stackoverflow.com/questions/45703215/how-to-generate-a-dynamic-link-for-a-specific-post-in-android-firebase/45704583#45704583 – Oleksiy Ivanov Oct 18 '17 at 18:30
  • I need the short link because for knowing which deep link has clicked. I know we can look at it in firebase Analytics but I have send a request to my service too. It seems that I can't receive it so I found out that there is a Rest api for it but I have kind of problem too. Would you mind if you look to this problem. I wrote the problem today at stackoverflow. Here is the link: https://stackoverflow.com/questions/46810942/how-to-get-the-correct-acces-token-for-firebase-dynamic-link-analytics-rest-api thanks for your attention. – Olcay Sönmez Oct 18 '17 at 18:43
  • Commented on REST API issue. About getting short link from iOS SDK: I have planned feature to return original long and short link to App from SDK. No promises on timeline. Another way how you can track: add some random number as deep link parameter to each link. You can use this number to identify the link. – Oleksiy Ivanov Oct 20 '17 at 06:17
  • that sounds great but we need this for Android SDK too but as a new feature that would be really great and really thanks your suggestion that would help. – Olcay Sönmez Oct 20 '17 at 06:33
  • 1
    Quick update here: we just launched editing existing links. So you can work around by: 1) create link; 2) edit link and add short link suffix as parameter to deep link; – Oleksiy Ivanov Oct 23 '17 at 21:25
  • thank you for the release. One more question, you mean that I can catch the deeplink with the suffix inside **pendingDynamicLinkData.getLink();** ? – Olcay Sönmez Oct 24 '17 at 22:15
  • Editing existing short links was rolled back, will be available in about 1 week. I meant that you can first create short link, later you can edit short link and append "short link suffix" to the deep link inside that short link. Yes, than you can get this in pendingDynamicLinkData.getLink() – Oleksiy Ivanov Oct 24 '17 at 23:04
  • I am really glad to hear that. Now I am happy. Thank you. :) – Olcay Sönmez Oct 25 '17 at 03:37
  • @OlcaySönmez can we edit the shortLink via SDK? – Build3r Feb 15 '22 at 08:29