<commit_before>#import "MWMAlertViewController.h"
#import "MWMFacebookAlert.h"
#import "Statistics.h"
#import <FBSDKShareKit/FBSDKShareKit.h>

#import "3party/Alohalytics/src/alohalytics_objc.h"

static NSString * const kFacebookAlertNibName = @"MWMFacebookAlert";
static NSString * const kFacebookAppName = @"https://fb.me/958251974218933";
static NSString * const kFacebookURL = @"http://www.facebook.com/MapsWithMe";
static NSString * const kFacebookScheme = @"fb://profile/111923085594432";
static NSString * const kFacebookAlertPreviewImage = @"http://maps.me/images/fb_app_invite_banner.png";
static NSString * const kFacebookInviteEventName = @"facebookInviteEvent";
extern NSString * const kUDAlreadySharedKey;

static NSString * const kStatisticsEvent = @"Facebook Alert";

@implementation MWMFacebookAlert

+ (MWMFacebookAlert *)alert
{
  [[Statistics instance] logEvent:kStatisticsEvent withParameters:@{kStatAction : kStatOpen}];
  MWMFacebookAlert * alert = [[[NSBundle mainBundle] loadNibNamed:kFacebookAlertNibName
                                                            owner:self
                                                          options:nil] firstObject];
  return alert;
}

#pragma mark - Actions

- (IBAction)shareButtonTap:(id)sender
{
  [[Statistics instance] logEvent:kStatisticsEvent withParameters:@{kStatAction : kStatApply}];
  [Alohalytics logEvent:kFacebookInviteEventName withValue:@"shareTap"];
  [self close];
  [[NSUserDefaults standardUserDefaults] setBool:YES forKey:kUDAlreadySharedKey];
  [[NSUserDefaults standardUserDefaults] synchronize];

  FBSDKAppInviteContent * const content = [[FBSDKAppInviteContent alloc] init];
  content.appLinkURL = [NSURL URLWithString:kFacebookAppName];
  content.appInvitePreviewImageURL = [NSURL URLWithString:kFacebookAlertPreviewImage];
  [FBSDKAppInviteDialog showWithContent:content delegate:nil];
}

- (IBAction)notNowButtonTap:(id)sender
{
  [[Statistics instance] logEvent:kStatisticsEvent withParameters:@{kStatAction : kStatClose}];
  [Alohalytics logEvent:kFacebookInviteEventName withValue:@"notNowTap"];
  [self close];
}

@end<commit_msg>[ios] Replaced deprecated facebook method.<commit_after>#import "MWMAlertViewController.h"
#import "MWMFacebookAlert.h"
#import "Statistics.h"
#import <FBSDKShareKit/FBSDKShareKit.h>

#import "3party/Alohalytics/src/alohalytics_objc.h"

static NSString * const kFacebookAlertNibName = @"MWMFacebookAlert";
static NSString * const kFacebookAppName = @"https://fb.me/958251974218933";
static NSString * const kFacebookURL = @"http://www.facebook.com/MapsWithMe";
static NSString * const kFacebookScheme = @"fb://profile/111923085594432";
static NSString * const kFacebookAlertPreviewImage = @"http://maps.me/images/fb_app_invite_banner.png";
static NSString * const kFacebookInviteEventName = @"facebookInviteEvent";
extern NSString * const kUDAlreadySharedKey;

static NSString * const kStatisticsEvent = @"Facebook Alert";

@implementation MWMFacebookAlert

+ (MWMFacebookAlert *)alert
{
  [[Statistics instance] logEvent:kStatisticsEvent withParameters:@{kStatAction : kStatOpen}];
  MWMFacebookAlert * alert = [[[NSBundle mainBundle] loadNibNamed:kFacebookAlertNibName
                                                            owner:self
                                                          options:nil] firstObject];
  return alert;
}

#pragma mark - Actions

- (IBAction)shareButtonTap:(id)sender
{
  [[Statistics instance] logEvent:kStatisticsEvent withParameters:@{kStatAction : kStatApply}];
  [Alohalytics logEvent:kFacebookInviteEventName withValue:@"shareTap"];
  [self close];
  [[NSUserDefaults standardUserDefaults] setBool:YES forKey:kUDAlreadySharedKey];
  [[NSUserDefaults standardUserDefaults] synchronize];

  FBSDKAppInviteContent * const content = [[FBSDKAppInviteContent alloc] init];
  content.appLinkURL = [NSURL URLWithString:kFacebookAppName];
  content.appInvitePreviewImageURL = [NSURL URLWithString:kFacebookAlertPreviewImage];
  [FBSDKAppInviteDialog showFromViewController:self.alertController.ownerViewController withContent:content delegate:nil];
}

- (IBAction)notNowButtonTap:(id)sender
{
  [[Statistics instance] logEvent:kStatisticsEvent withParameters:@{kStatAction : kStatClose}];
  [Alohalytics logEvent:kFacebookInviteEventName withValue:@"notNowTap"];
  [self close];
}

@end
{'fraction_non_alphanumeric': 0.1037411062657792, 'fraction_numerical': 0.0142299747532706, 'mean_word_length': 5.3251088534107405, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 42, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2369717', 'n_tokens_mistral': 1399, 'n_tokens_neox': 1240, 'n_words': 238}