0

I'm new to Firebase. I'm trying to make use of Dynamic Links. This is what I have so far...

    var longUrl = 'https://example.com/' + window.location.hash;
    var APIkey  = 'My Web API Key Here';
    var url     = 'https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=' + APIkey;

    var data = {
        "longDynamicLink": "https://abc123.app.goo.gl/?link=" + longUrl,
        "suffix": {
            "option": "SHORT"
        }
    };

    var request = $.ajax({
        url: url,
        dataType: 'json',
        type: 'post',
        contentType: 'application/json',
        data: JSON.stringify(data),
        processData: false,
        success: function( data, textStatus, jQxhr ){
            console.log(data);
            console.log(textStatus);
            console.log(jQxhr);
        },
        error: function( jqXhr, textStatus, errorThrown ){
            console.log( errorThrown );
        }
    });

And I get a 400 error...

code:400
message:"Your project has not configured Dynamic Links. [https://firebase.google.com/docs/dynamic-links/rest#before_you_begin]"
status:"INVALID_ARGUMENT"

What does it mean by not configured Dynamic Links? Is "abc123" just a placeholder?

Peter Haddad
  • 78,874
  • 25
  • 140
  • 134
Adam Youngers
  • 6,421
  • 7
  • 38
  • 50

2 Answers2

1

Had the same issue- and thats the answer i got from the firebase team:

Take note that to be able to view your Dynamic Link domain you'll have to add an app first. If you're using Firebase Dynamic Link as a substitute to Google Shortener, you can create a sample application (dummy app) for your project to proceed creating a Firebase Dynamic Links. Just enter dummy values for the iOS bundle ID or Android package name (ex: “my.dummy.app”) to continue.

then you'll put the id you'll get from it (e.g. https://dedfgu.app.goo.gl) instead of the place holder (abc123.app.goo.gl).

Good luck!

DasDas
  • 571
  • 3
  • 9
  • 32
0

abc123 is a placeholder. You supposed to provide your Firebase Dynamic Links domain instead of abc123.

For example see here https://firebase.google.com/docs/dynamic-links/ios/create description what is project's Dynamic Links domain. Domain looks like app_code.app.goo.gl, where app_code is unique to each Firebase project.

Oleksiy Ivanov
  • 2,454
  • 15
  • 21
  • I'm using the REST docs and it doesn't mention anywhere that abc123 is a placeholder. I kind of assumed it was but figured it my just be Google being googly. https://firebase.google.com/docs/dynamic-links/rest – Adam Youngers Nov 22 '17 at 16:48
  • I'm not seeing the Dynamic Links section in my control panel. Is it a sub section of another area? – Adam Youngers Nov 22 '17 at 16:55
  • Okay. I found the menu item under Grow in the control panel, but all I see is options for Android or iOS. I'm not seeing anything for Web. Maybe I'm misunderstanding the feature. I want to offer sharable links within my web app to replace the long ones I have now. – Adam Youngers Nov 22 '17 at 17:06
  • app_code is the same for all platforms, did you tried to app_code from iOS or Android sub-pages in your Firebase Console? Firebase primary goal is to help mobile app developers, that's why www docs may be less clear. – Oleksiy Ivanov Nov 27 '17 at 04:54