0

I have added the SHKSharer Delegate delegate to my .h and the methods to my .m but not seeing any evidence of the method being called during my share. Am I missing something?

.h

interface ShareViewController : UIViewController <SHKSharerDelegate, FBDialogDelegate, SHKShareItemDelegate> {

}

.m

- (IBAction)FBShare:(id)sender {

// Create the item to share (in this example, a url)
NSURL *url = [NSURL URLWithString:@"https://itunes.apple.com/us/app/mysite-ver-   4.0/id603390620?ls=1&mt=8"];


SHKItem *item = [SHKItem URL:url title:@"Development test FB post ver 6.0" contentType:SHKURLContentTypeWebpage];

SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];


[SHK setRootViewController:self];


[actionSheet showInView:self.view];

SHKSharer *faceBookSharer = [[SHKSharer alloc] init];
faceBookSharer.shareDelegate = self;
[faceBookSharer shareItem:item];

- (void)sharerStartedSending:(SHKSharer *)sharer
{

NSLog(@"sharerStartedSending");
}

- (void)sendDidFinish:(SHKSharer *)sharer
{

NSLog(@"sendDidFinish");
}

- (void)sendDidStart:(SHKSharer *)sharer

{

NSLog(@"sendDidStart");
}

- (void)sharerFinishedSending:(SHKSharer *)sharer {
 NSLog(@"Sharefinishedsending");
}

1 Answers1

0

You have to supply the delegate to a particular sharer. e.g.

SHKYouTube *youTubeSharer = [[SHKYouTube alloc] init];
youTubeSharer.shareDelegate = <your delegate>;
[youTubeSharer loadItem:<yourItem>];
[youTubeSharer share];

However, if you do not use sharers directly, this is not convenient. I will open an issue (and do it most probably :) So that custom sharer delegate can be supplied via configuration for all sharers at once.

You can check progress here

Vilém Kurz
  • 3,401
  • 2
  • 34
  • 43