пожалуйста, попробуйте это:
guard let link = URL(string: sahareUrl) else { return }
let dynamicLinksDomain = "name.page.link"
let linkBuilder = FIRDynamicLinkComponents(link: link, domain: dynamicLinksDomain)
linkBuilder.socialMetaTagParameters = FIRDynamicLinkSocialMetaTagParameters()
linkBuilder.options = FIRDynamicLinkComponentsOptions()
linkBuilder.options?.pathLength = .short
linkBuilder.socialMetaTagParameters?.imageURL = URL(string: imagename)
linkBuilder.iOSParameters = FIRDynamicLinkIOSParameters(bundleID: "yourBundleId")
linkBuilder.iOSParameters?.appStoreID = "storeId"
linkBuilder.iOSParameters?.iPadBundleID = "yourBundleId"
linkBuilder.androidParameters = FIRDynamicLinkAndroidParameters(packageName: "packageNameOfAndroid")
linkBuilder.socialMetaTagParameters?.title = title
linkBuilder.socialMetaTagParameters?.descriptionText = description
guard let longDynamicLink = linkBuilder.url else { return }
print(longDynamicLink)
FIRDynamicLinkComponents.shortenURL(longDynamicLink, options: nil) { url, warnings, error in
self.runOnUIThread {
if url != nil{
self.shareAds(item: [url!])
}else{
NVActivityIndicatorHelper.hideIndicatorInView()
}
}
}
Это может помочь вам. Спасибо