Tôi đã sử dụng mã này để đăng bài trên twitter.SLCOmposeviewcontroller twitter sharing alert issue
SLComposeViewController *fbController=[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
{
SLComposeViewControllerCompletionHandler __block completionHandler=^(SLComposeViewControllerResult result){
[fbController dismissViewControllerAnimated:YES completion:nil];
switch(result){
case SLComposeViewControllerResultCancelled:
default:
{
NSLog(@"Cancelled.....");
}
break;
case SLComposeViewControllerResultDone:
{
NSLog(@"Posted....");
UIAlertView *alertView = [[UIAlertView alloc]
initWithTitle:@"Success"
message:@"Posted Successfully"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
}
break;
}};
[fbController addImage:[UIImage imageNamed:@"1.jpg"]];
[fbController setInitialText:@"Check out this article."];
//[fbController addURL:[NSURL URLWithString:@"http://soulwithmobiletechnology.blogspot.com/"]];
[fbController setCompletionHandler:completionHandler];
[self presentViewController:fbController animated:YES completion:nil];
}
Nếu người dùng không thiết lập tài khoản twitter, nó hiển thị cảnh báo có cài đặt và nút hủy. Nhưng nó không hiển thị cảnh báo trong Thiết bị? Bất kỳ ai có thể giúp tôi được không. Cảm ơn trước .
Nhưng nó không hiển thị cảnh báo trong Thiết bị? không nhận được điều bạn yêu cầu ... :( –
Bạn có chắc chắn rằng bạn đang chạy> ios 6.0 trong thiết bị –
Có abhilash thiết bị iOS của tôi là 6.1.3 – Tendulkar