Skip to content
Browse files

Add custom Insights logging for Share Sheet launch, cancel, and post

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...
1 parent 131e4d0 commit 69a8dfd84fc9902013bcc8bc65d240c9114d0075 @gregschechter gregschechter committed Sep 25, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/FBNativeDialogs.m
View
9 src/FBNativeDialogs.m
@@ -17,6 +17,7 @@
#import "FBNativeDialogs.h"
#import "FBSession.h"
#import "FBError.h"
+#import "FBUtility.h"
#import "Social/Social.h"
@interface FBNativeDialogs ()
@@ -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;
}

0 comments on commit 69a8dfd

Please sign in to comment.
Something went wrong with that request. Please try again.