Share via facebook using sharekit gives error auth failed:Error Domain=com.apple.accounts Code=6

83 Views Asked by At

I am trying to implement sharing a link via facebook in my app using sharekit. But when I click on the share button it is giving me an error as

SHKiOSSharer.m:(153)> auth failed:Error Domain=com.apple.accounts Code=6 "(null)" 2017-12-07 18:59:25.705666+0530 Wishfie[3762:1552285] <-[SHKiOSSharer presentNoAvailableAccountAlert] SHKiOSSharer.m:(176)> User revoked access in settings.app, or in service itself. 2017-12-07 18:59:25.734617+0530 Wishfie[3762:1552285] <-[SHKSharer dealloc] SHKSharer.m:(51)> !!! Facebook sharer deallocated!!!

My share function looks loke this

-(IBAction)shareButtonAction:(UIButton *)sender{

NSURL *url = [NSURL URLWithString:@"www.google.com"];
SHKItem *item = [SHKItem URL:url title:@"Some test title" contentType:SHKURLContentTypeWebpage];

[SHK setRootViewController:self];

// Display the action sheet
if (NSClassFromString(@"UIAlertController")) {

    //iOS 8+
    SHKAlertController *alertController = [SHKAlertController actionSheetForItem:item];
    [alertController setModalPresentationStyle:UIModalPresentationPopover];
    UIPopoverPresentationController *popPresenter = [alertController popoverPresentationController];
    popPresenter.barButtonItem = self.toolbarItems[1];
    [self presentViewController:alertController animated:YES completion:nil];

} else {

    //deprecated
    SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];
    [actionSheet showFromToolbar:self.navigationController.toolbar];
}

What this error is and how to resolve it?

0

There are 0 best solutions below