Create firebase dynamic link using rest api


You can create short Dynamic Links with the Firebase Dynamic Links REST API. This API accepts either a long Dynamic Link or an object containing Dynamic Link parameters, and returns a URL like the following example:

https://example.page.link/WXYZ
  1. Get your API key. You will need an API key to authenticate your requests to the API. To find your API key:
    1. Open the Settings page of the Firebase console. If you are prompted to choose a project, select your Firebase project from the menu.
    2. Take note of the value of the Web API Key field.
  2. In the Firebase console, open the Dynamic Links section.
  3. If you have not already accepted the terms of service and set a domain for your Dynamic Links, do so when prompted.

    If you already have a Dynamic Links domain, take note of it. You need to provide a Dynamic Links domain when you programmatically create Dynamic Links.

POST https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=api_key
Content-Type: application/json

{
   "longDynamicLink": "https://example.page.link/?link=https://www.example.com/&apn=com.example.android&ibi=com.example.ios"
}

POST https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=api_key
Content-Type: application/json

{
  "dynamicLinkInfo": {
    "domainUriPrefix": "https://example.page.link",
    "link": "https://www.example.com/",
    "androidInfo": {
      "androidPackageName": "com.example.android"
    },
    "iosInfo": {
      "iosBundleId": "com.example.ios"
    }
  }
}
GET https://firebasedynamiclinks.googleapis.com/v1/SHORT_DYNAMIC_LINK/linkStats?durationDays=DURATION

Authorization: Bearer ACCESS_TOKEN

For example, to retrieve statistics from the last 7 days for the short link https://example.page.link/wXYz:

GET https://firebasedynamiclinks.googleapis.com/v1/https%3A%2F%2Fexample.page.link%2FwXYz/linkStats?durationDays=7

Authorization: Bearer ya29.Abc123...



Post a Comment

Previous Post Next Post

Subscribe Us


Get tutorials, Flutter news and other exclusive content delivered to your inbox. Join 1000+ growth-oriented Flutter developers subscribed to the newsletter

100% value, 0% spam. Unsubscribe anytime