I was able to create persisting link in firebase dynamic link using API in node. I did the following.
- Create oauth2 client
import {google} from "googleapis";
const oauth2Client = new google.auth.GoogleAuth({
keyFile: "path to service account json file",
scopes: ['https://www.googleapis.com/auth/firebase']
})
- Create link data object
const data = {
"dynamicLinkInfo": {
"domainUriPrefix": "https://myapp.page.link",
"link": "my deeplink",
"androidInfo": {
"androidFallbackLink": "",
"androidLink": "",
"androidMinPackageVersionCode": "",
"androidPackageName": bundleName // android package name, fe my.app.io
},
"iosInfo": {
"iosAppStoreId": `${isi}`, // app store app id
"iosBundleId": bundleName, // ios app bundle id, fe my.app.io
"iosCustomScheme": "",
"iosFallbackLink": "",
"iosIpadBundleId": "",
"iosIpadFallbackLink": ""
},
"navigationInfo": {
"enableForcedRedirect": false
},
"analyticsInfo": {
"googlePlayAnalytics": {
"utmCampaign": "",
"utmMedium": "",
"utmSource": ""
},
"itunesConnectAnalytics": {
"at": "",
"ct": "",
"mt": "",
"pt": ""
}
},
"socialMetaTagInfo": {
"socialDescription": "",
"socialImageLink": "",
"socialTitle": ""
},
},
"name": "Link name column from FDL",
"suffix": {
"customSuffix": "URL_prefix_during_link_creation_from_FDL, "option": "CUSTOM"
}
}
- Call the API
oauth2Client.request({
method: "POST",
url: "https://firebasedynamiclinks.googleapis.com/v1/managedShortLinks:create",
data: data
})
Links:
As far as I know, you cannot use any direct REST API since you need appropriate oauth2 access_token for specific scope. I was trying to spoof FDL requests and reflect it behaviour without success, but this works.