-
-
Save JuneJuneCute/039871a0731eff92ee52a1c30b3ab904 to your computer and use it in GitHub Desktop.
Example on how to determine Facebook app invite completion state
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - Facebook App Invite Delegate | |
- (void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didCompleteWithResults:(NSDictionary *)results | |
{ | |
NSLog(@"app invite result: %@", results); | |
BOOL complete = [[results valueForKeyPath:@"didComplete"] boolValue]; | |
NSString *completionGesture = [results valueForKeyPath:@"completionGesture"]; | |
// NOTE: the `cancel` result dictionary will be | |
// { | |
// completionGesture = cancel; | |
// didComplete = 1; | |
// } | |
// else, it will only just `didComplete` | |
if (completionGesture && [completionGesture isEqualToString:@"cancel"]) { | |
// handle cancel state... | |
return; | |
} | |
if (complete) { // if completionGesture is nil -> success | |
[SVProgressHUD showSuccessWithStatus:NSLocalizedString(@"Your invite has been sent.", nil)]; | |
} | |
} | |
- (void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didFailWithError:(NSError *)error | |
{ | |
NSLog(@"app invite error: %@", error.localizedDescription); | |
// handle error... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment