我正在使用Firebase动态链接与链接shortener,我想定义客户端的后备链接除了安卓和iOS。Manually constructed动态链接有一个参数ofl,它做的正是我需要的The link to open on platforms beside Android and iOS。但是,在shortener文档中似乎缺少此参数。虽然在缩写文档When users open a Dynamic Link on a desktop web browser, they will load this URL (unless the ofl parameter is specified)中对链接参数的描述中提到了ofl。
除了安卓和iOS之外,有没有可能为客户端添加一个备用url (例如web),以将用户重定向到那里而不是link参数
发布于 2019-02-13 13:36:58
通过使用REST API
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"
},
"desktopInfo": {
"desktopFallbackLink": "https://www.other-example.com/"
},
}
}发布于 2019-08-28 13:04:53
在短动态链接中设置回退url的最简单方法是手动创建长链接,然后使用sdk将其转换为短链接:
val longLink = "$domain/?link=$deepLink&apn=$androidPackage&ibi=$iosPackage&isi=$iosAppStoreId&ofl=$desktopFallbackLink"
FirebaseDynamicLinks
.getInstance()
.createDynamicLink()
.setLongLink(Uri.parse(link))
.buildShortDynamicLink()
.addOnSuccessListener {
val shortLink = it.shortLink
//do something with the link here
}https://stackoverflow.com/questions/54402506
复制相似问题