Reputation: 4019
I need to know when a sharer has been authorized (to change some UI) and it looks like there's a SharerDelegate sharerAuthDidFinish method which (I think) I implemented, but it doesn't get called.
Anyone?
Thanks!
Upvotes: 1
Views: 603
Reputation: 1283
In SHKSharer.m, there is the following code:
- (void)authDidFinish:(BOOL)success
{
[[NSNotificationCenter defaultCenter] postNotificationName:@"SHKAuthDidFinish" object:self userInfo:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:success] forKey:@"success"]];
if ([self.shareDelegate respondsToSelector:@selector(sharerAuthDidFinish:success:)]) {
[self.shareDelegate sharerAuthDidFinish:self success:success];
}
}
So you can listen for the notification in whatever class needs to know like such:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sharerAuthorized:) name:@"SHKAuthDidFinish" object:nil];
and then implement a method like:
- (void)sharerAuthorized:(NSNotification *)notification {
//check for success and type of sharer
//do whatever you need to do once it is authorized
}
Upvotes: 3