titanium-ios-facebook
titanium-ios-facebook copied to clipboard
Implement Message Dialog
In order to have users invite friends to the app I need the Message Dialog to send a link: https://developers.facebook.com/docs/ios/share
// Check if the Facebook app is installed and we can present
// the message dialog
FBLinkShareParams *params = [[FBLinkShareParams alloc] init];
params.link =
[NSURL URLWithString:@"https://developers.facebook.com/docs/ios/share/"];
params.name = @"Message Dialog Tutorial";
params.caption = @"Build great social apps that engage your friends.";
params.picture = [NSURL URLWithString:@"http://i.imgur.com/g3Qc1HN.png"];
params.description = @"Send links from your app using the iOS SDK.";
// If the Facebook app is installed and we can present the share dialog
if ([FBDialogs canPresentMessageDialogWithParams:params]) {
// Enable button or other UI to initiate launch of the Message Dialog
} else {
// Disable button or other UI for Message Dialog
}