除非我将Facebook API集成到我的iOS应用程序中,否则我将使用此命令分享一些打开Facebook本机应用程序的文本,您可以在此处看到:
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]];
}
Run Code Online (Sandbox Code Playgroud)
它可以从我的iPhone应用程序正常工作,但不适用于iPad.在iPad中它只打开Facebook应用程序,但没有打开iPhone案例中的文字.
| 归档时间: |
|
| 查看次数: |
900 次 |
| 最近记录: |