Before give duplicate mark read my whole question:
I know might be there is many question related to my title but issue is different.
I am using Mac OS X 10.9.3
and Xcode 5.1.1
.
In my app I just want to share image, URL link and some description on Facebook and Twitter so I used SLComposeViewController
and my code is below.
-(void)btnShareTapped:(UIButton *)sender
{
if(sender.tag == 100)
[self shareProductContentOnTwitterORFB:@"Facebook"];
else
[self shareProductContentOnTwitterORFB:@"Twitter"];
}
Method body:
-(void) shareProductContentOnTwitterORFB:(NSString *) shareON
{
SLComposeViewController *shareKit = nil; // also tried with [[SLComposeViewController alloc] init];
if([shareON isEqualToString:@"Twitter"])
shareKit = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
else
shareKit = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
[shareKit setInitialText:@"My Description Text."];
[shareKit addImage:[UIImage imageNamed:@"boston-shopping.jpg"]]; // I also tried with .png image
[shareKit addURL:[NSURL URLWithString:@"www.google.com"]];
//[self.view.window.rootViewController presentViewController:shareKit animated:YES completion:nil];
[self presentViewController:shareKit animated:YES completion:nil]; /// I also tried with above comment.
}
After execute above code, SLComposeViewController
will be open and in my console
<Error>: CGImageCreate: invalid image size: 0 x 0.
display only with Facebook and get exactly same problem Look at this question.
I am sure my image is not nil
, I was checked it.
Above question said -
This bug seems to be fixed in new version of iOS (6.0.1) At least I have all working well since my last updgrade.
But I am testing on iOS 6.1 still I am getting same issue and in iOS 7.0 and 7.1 the error message in console (<Error>: CGImageCreate: invalid image size: 0 x 0.
) Not display but I cam not able to go to on setting App in both Facebook and Twitter.
What is problem ? where I am wrong? Is this apple Bug ??
Please give your suggestion.