Skip to content

Commit

Permalink
Add custom Insights logging for Share Sheet launch, cancel, and post
Browse files Browse the repository at this point in the history
Summary: Now that FBNativeDialogs is in, extend the Custom Insights logging introduced earlier tonight to Share Sheet operations.

Test Plan: Tested by invoking the share sheet and watching things go.  Hit what I think Jason described as a bug with loginType that's causing the share sheet display to fail, but worked around it for the testing.

Reviewers: jacl, clang

Reviewed By: jacl

CC: msdkexp@

Differential Revision: https://phabricator.fb.com/D583401
  • Loading branch information
gregschechter committed Sep 25, 2012
1 parent 131e4d0 commit 69a8dfd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/FBNativeDialogs.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#import "FBNativeDialogs.h"
#import "FBSession.h"
#import "FBError.h"
#import "FBUtility.h"
#import "Social/Social.h"

@interface FBNativeDialogs ()
Expand Down Expand Up @@ -85,12 +86,18 @@ + (BOOL)presentShareDialogModallyFrom:(UIViewController*)viewController
}

[composeViewController setCompletionHandler:^(SLComposeViewControllerResult result) {
BOOL cancelled = (result == SLComposeViewControllerResultCancelled);
NSString *eventToLog = cancelled ? @"_shareSheetCancel" : @"_shareSheetPost";
[FBUtility logInsightsEvent:eventToLog session:session];
if (handler) {
handler((result == SLComposeViewControllerResultDone) ?FBNativeDialogResultSucceeded : FBNativeDialogResultCancelled, nil);
handler(cancelled ? FBNativeDialogResultCancelled : FBNativeDialogResultSucceeded, nil);
}
}];

[viewController presentModalViewController:composeViewController animated:YES];

[FBUtility logInsightsEvent:@"_shareSheetLaunch" session:session];

return YES;
}

Expand Down

0 comments on commit 69a8dfd

Please sign in to comment.