Search code examples
iosswiftfirebasedeep-linkingimessage

iMessage | Slack - Firebase Dynamic Link shorten URL is not working


The Firebase shortenURL is working as expected in every app except iMessage and Slack.

The sharing screen is stuck with Slack. handleUniversalLink decoding returns a 404 error with iMessage.

Please note that, copy and paste of the shortenURL is working as expected.

let activityVC = UIActivityViewController(activityItems: [shortenURL], applicationActivities: nil)
activityVC.popoverPresentationController?.sourceView = self.view
self.present(activityVC, animated: true)

Any help on this is highly appreciated.


Solution

  • The solution is to include some prefix text with the shortenURL and share them together. 

    let promoText = "You have been invited to this. "
    let activityVC = UIActivityViewController(activityItems: [promoText + shortenURL.absoluteString], applicationActivities: nil)
    activityVC.popoverPresentationController?.sourceView = self.view
    self.present(activityVC, animated: true)