답변

2

대리인에 다음과 같은 방법을 구현 :

- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { 
id tracker = [[GAI sharedInstance] defaultTracker]; 
switch (result) { 
    case MFMailComposeResultCancelled: 
     [tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"ui_action"                action:@"event_action" // Event action (required) 
      label:@"Cancelled"   // Event label 
      value:nil] build]]; // Event value 
      break; 
    case MFMailComposeResultSaved: 
     [tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"ui_action"                action:@"event_action" // Event action (required) 
      label:@"Saved"   // Event label 
      value:nil] build]]; // Event value 
      break; 
    case MFMailComposeResultSent: 
     [tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"ui_action"                action:@"event_action" // Event action (required) 
      label:@"Sent"   // Event label 
      value:nil] build]]; // Event value 
      break; 
    case MFMailComposeResultFailed: 
     [tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"ui_action"                action:@"event_action" // Event action (required) 
      label:@"Failed"   // Event label 
      value:nil] build]]; // Event value 
      break; 
    default: 
      break; 
} 
}