I am developping an iOS application using Swift 4.
I need that the user can invite his Facebook friends to use this application.
I tried this code :
func inviteFacebookFriends(){
let dialog = FBSDKAppInviteDialog()
let content:FBSDKAppInviteContent = FBSDKAppInviteContent()
content.appLinkURL = URL(string: "https://example/fbid")
content.appInvitePreviewImageURL = URL(string: "http://www.queness.com/resources/images/png/apple_ex.png")
dialog.content = content
dialog.delegate = self
do {
try dialog.validate()
}
catch {
print(error)
}
dialog.show()
}
But nothing happened, there's no dialog appears.
please help me to solve this issue.
Facebook invite is no longer allowed by Facebook SDK. There's no way to use
FBSDKAppInviteDialoganymore.From Facebook docs
You will have to find an other way than Facebook to invite friends.