<commit_before>//
//  MWMFacebookAlert.m
//  Maps
//
//  Created by v.mikhaylenko on 01.04.15.
//  Copyright (c) 2015 MapsWithMe. All rights reserved.
//

#import "MWMFacebookAlert.h"
#import "MWMAlertViewController.h"
#import "UIKitCategories.h"
#import <FBSDKShareKit/FBSDKShareKit.h>

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

static NSString * const kFacebookAlertNibName = @"MWMFacebookAlert";
static NSString * const kFacebookAppName = @"https://fb.me/918866338157497";
static NSString * const kFacebookURL = @"http://www.facebook.com/MapsWithMe";
static NSString * const kFacebookScheme = @"fb://profile/111923085594432";
static NSString * const kFacebookAlertPreviewImage = @"http://ru3.mapswithme.com/fb-1.png";
static NSString * const kFacebookInviteEventName = @"facebookInviteEvent";
extern NSString * const kUDAlreadySharedKey;

@interface MWMFacebookAlert ()

@property (nonatomic, weak) IBOutlet UILabel *titleLabel;
@property (nonatomic, weak) IBOutlet UILabel *messageLabel;
@property (nonatomic, weak) IBOutlet UIButton *notNowButton;
@property (nonatomic, weak) IBOutlet UIButton *shareButton;

@end

@implementation MWMFacebookAlert

+ (MWMFacebookAlert *)alert
{
  MWMFacebookAlert *alert = [[[NSBundle mainBundle] loadNibNamed:kFacebookAlertNibName owner:self options:nil] firstObject];
  [alert configure];
  return alert;
}

#pragma mark - Actions

- (IBAction)shareButtonTap:(id)sender
{
  [Alohalytics logEvent:kFacebookInviteEventName withValue:@"shareTap"];
  [[Statistics instance] logEvent:[NSString stringWithFormat:@"%@ShareTap", kFacebookInviteEventName]];
  [self.alertController closeAlert];
  [[NSUserDefaults standardUserDefaults] setBool:YES forKey:kUDAlreadySharedKey];
  [[NSUserDefaults standardUserDefaults] synchronize];

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

- (IBAction)notNowButtonTap:(id)sender
{
  [Alohalytics logEvent:kFacebookInviteEventName withValue:@"notNowTap"];
  [[Statistics instance] logEvent:[NSString stringWithFormat:@"%@NotNowTap", kFacebookInviteEventName]];
  [self.alertController closeAlert];
}

#pragma mark - Configure

- (void)configure
{
  CGFloat const topMainViewOffset = 17.;
  CGFloat const secondMainViewOffset = 14.;
  CGFloat const thirdMainViewOffset = 20.;
  [self.titleLabel sizeToFit];
  [self.messageLabel sizeToFit];
  CGFloat const mainViewHeight = topMainViewOffset + secondMainViewOffset + thirdMainViewOffset + self.titleLabel.height + self.messageLabel.height + self.notNowButton.height;
  self.height = mainViewHeight;
  self.titleLabel.minY = topMainViewOffset;
  self.messageLabel.minY = self.titleLabel.maxY + secondMainViewOffset;
  self.notNowButton.minY = self.messageLabel.maxY + thirdMainViewOffset;
  self.shareButton.minY = self.notNowButton.minY;
}

@end
<commit_msg>Fixed iOS banner FB invite url.<commit_after>//
//  MWMFacebookAlert.m
//  Maps
//
//  Created by v.mikhaylenko on 01.04.15.
//  Copyright (c) 2015 MapsWithMe. All rights reserved.
//

#import "MWMFacebookAlert.h"
#import "MWMAlertViewController.h"
#import "UIKitCategories.h"
#import <FBSDKShareKit/FBSDKShareKit.h>

#import "Statistics.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;

@interface MWMFacebookAlert ()

@property (nonatomic, weak) IBOutlet UILabel *titleLabel;
@property (nonatomic, weak) IBOutlet UILabel *messageLabel;
@property (nonatomic, weak) IBOutlet UIButton *notNowButton;
@property (nonatomic, weak) IBOutlet UIButton *shareButton;

@end

@implementation MWMFacebookAlert

+ (MWMFacebookAlert *)alert
{
  MWMFacebookAlert *alert = [[[NSBundle mainBundle] loadNibNamed:kFacebookAlertNibName owner:self options:nil] firstObject];
  [alert configure];
  return alert;
}

#pragma mark - Actions

- (IBAction)shareButtonTap:(id)sender
{
  [Alohalytics logEvent:kFacebookInviteEventName withValue:@"shareTap"];
  [[Statistics instance] logEvent:[NSString stringWithFormat:@"%@ShareTap", kFacebookInviteEventName]];
  [self.alertController closeAlert];
  [[NSUserDefaults standardUserDefaults] setBool:YES forKey:kUDAlreadySharedKey];
  [[NSUserDefaults standardUserDefaults] synchronize];

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

- (IBAction)notNowButtonTap:(id)sender
{
  [Alohalytics logEvent:kFacebookInviteEventName withValue:@"notNowTap"];
  [[Statistics instance] logEvent:[NSString stringWithFormat:@"%@NotNowTap", kFacebookInviteEventName]];
  [self.alertController closeAlert];
}

#pragma mark - Configure

- (void)configure
{
  CGFloat const topMainViewOffset = 17.;
  CGFloat const secondMainViewOffset = 14.;
  CGFloat const thirdMainViewOffset = 20.;
  [self.titleLabel sizeToFit];
  [self.messageLabel sizeToFit];
  CGFloat const mainViewHeight = topMainViewOffset + secondMainViewOffset + thirdMainViewOffset + self.titleLabel.height + self.messageLabel.height + self.notNowButton.height;
  self.height = mainViewHeight;
  self.titleLabel.minY = topMainViewOffset;
  self.messageLabel.minY = self.titleLabel.maxY + secondMainViewOffset;
  self.notNowButton.minY = self.messageLabel.maxY + thirdMainViewOffset;
  self.shareButton.minY = self.notNowButton.minY;
}

@end

{'fraction_non_alphanumeric': 0.11056751467710371, 'fraction_numerical': 0.015655577299412915, 'mean_word_length': 6.534398034398034, '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': 40, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2142927', 'n_tokens_mistral': 2140, 'n_tokens_neox': 1916, 'n_words': 391}