Open the Facebook app with text from the iPad app

If I do not integrate the Facebook API into my iOS application, I am sharing the text that opens the Facebook native application with this command, which you can see here:

NSString *urlString = [NSString stringWithFormat:@"%@",
                       [self.txtAdreca.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];

NSString *post = [NSString stringWithFormat:@"fb://publish/profile/me?text=%@",urlString];
BOOL canOpenURL = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:post]];
if (canOpenURL) {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:post]];
}

It works correctly with my iPhone application, but not on the iPad. On the iPad, he only opens the Facebook application, but not with the text written, as in the case of the iPhone.

+5
source share

All Articles