2

I am facing one issue, in 64 bit architecture iOS device the sharing feature (Twitter and Facebook) is not working, when same code I am running in 32 Bit architecture iOS device its working fine. I have changed the architecture also as armv7 armv7s arm64. But still I am facing the same issue.

/* Facebook sharing  */
SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
    [controller setInitialText:ARTICLE_GLOBAL_Title];
    [controller addImage:[UIImage imageNamed:@"144X144.png"]];
    [controller addURL:[NSURL URLWithString:ARTICLE_GLOBAL_Link]];
    [self presentViewController:controller animated:YES completion:nil];

Here is the output

plugin com.apple.share.Facebook.post interrupted Hub connection error Error Domain=NSCocoaErrorDomain Code=4097 "The operation couldn’t be completed. (Cocoa error 4097.)" (connection to service named com.apple.share.Facebook.post) UserInfo=0x7f839249d090 {NSDebugDescription=connection to service named com.apple.share.Facebook.post }

Pang
  • 9,564
  • 146
  • 81
  • 122
Piyush
  • 580
  • 1
  • 5
  • 23

1 Answers1

2

I had a similar problem that only appeared on iOS 8. I resolved the error by removing addURL: if the device is running iOS 8.

 if (!SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
    [controller addURL:[NSURL URLWithString:ARTICLE_GLOBAL_Link]];
 }

where

#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)

Seems to be a problem attaching the URL to the post. For iOS 8, I appended the URL to the initial text rather than use addURL:.

Rob Wright
  • 3,374
  • 2
  • 18
  • 12