I\'m writing an iPhone application.
I want to give the user the option to invite friends to start using my application via Facebook.
More specifically I want to
To send facebook app invites, you need to first add details of your app here.. https://developers.facebook.com/quickstarts/?platform=app-links-host
In Swift 2.2, XCode 7.3 and FBSDK 4.1
import FBSDKShareKit
import FBSDKCoreKit
import FBSDKLoginKit
Add FBSDKAppInviteDialogDelegate
with your ViewController class.
func appInviteDialog(appInviteDialog: FBSDKAppInviteDialog!, didCompleteWithResults results: [NSObject : AnyObject]!) {
print("Initiation sent")
}
func appInviteDialog(appInviteDialog: FBSDKAppInviteDialog!, didFailWithError error: NSError!) {
print("\(error)")
}
let content = FBSDKAppInviteContent();
content.appLinkURL = NSURL(string: "fb link that you get in above developers facebook url"); //"https:// fb.me/1775107252721102" in my case
FBSDKAppInviteDialog.showFromViewController(self, withContent: content, delegate: self);