我已将SHKSharer委托委托添加到我的.h以及我的.m的方法,但没有看到在我的共享期间调用该方法的任何证据。我错过了什么吗?
·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");
}
答案 0 :(得分:0)
您必须将代理提供给特定的共享者。 e.g。
SHKYouTube *youTubeSharer = [[SHKYouTube alloc] init];
youTubeSharer.shareDelegate = <your delegate>;
[youTubeSharer loadItem:<yourItem>];
[youTubeSharer share];
但是,如果您不直接使用共享者,则不方便。我将打开一个问题(并且最有可能:)这样可以通过配置为所有共享者提供自定义共享者委托。
您可以查看进度here