2
votes

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 }

1
which version of xcode are you using? - Asif Asif
Please suggest me something, what to do ?? - Piyush
have you tested on a device yet? - Asif Asif
I have iPhone 4s. On that its working fine. But when i am running this code in simulator iPhone 6, Its showing me error message on console. - Piyush
is your 4s running on iOS 8? - Asif Asif

1 Answers

2
votes

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:.