iOS - Firebase dynamic linking with Facebook friends invite issue

612 Views Asked by At

I am using firebase dynamic linking to send app invitation using email and sms gateway. Basically, I am sending the invite code in deep link. User who's installs with that invite code is connected to my user circle.

Now, I want to send invite code to my Facebook friends. Is there a way to send deep link through Facebook invite.

Following is the code to send the Facebook app invite:

@IBAction func showFacebookInvite(_ sender: AnyObject) {
    let content = FBSDKAppInviteContent()
    content.appLinkURL = URL(string: "https://fb.meXXXXX")

    let obj = FBSDKAppInviteDialog()

    obj.content = content
    obj.delegate = self
    let temp = FBSDKAppInviteDialog.validate(obj)
    print(temp)

    content.destination = .facebook
    FBSDKAppInviteDialog
        .show(from: self, with: content, delegate: self)
}

Any suggestions.

1

There are 1 best solutions below

3
Oleksiy Ivanov On

You can assign Firebase Dynamic Link to content.appLinkURL . When Facebook friend accepts the invite, friend will navigate to the link and install the App.

This should function identical to email/sms gateway.

To create short FDL links use iOS Builder API https://firebase.google.com/docs/dynamic-links/ios/create