Welcome to mirror list, hosted at ThFree Co, Russian Federation.

LocalNotificationInfoProvider.m « Classes « Maps « iphone - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 20b2fa9543d49e30f75721881577309fc49cafb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
//  LocalNotificationInfoProvider.m
//  Maps
//
//  Created by Timur Bernikowich on 25/11/2014.
//  Copyright (c) 2014 MapsWithMe. All rights reserved.
//

#import "LocalNotificationInfoProvider.h"
#import "UIKitCategories.h"

@implementation LocalNotificationInfoProvider

- (instancetype)initWithDictionary:(NSDictionary *)info
{
  self = [super init];
  if (self)
    _info = info;
  return self;
}

#pragma mark - Activity Item Source

- (id)activityViewControllerPlaceholderItem:(UIActivityViewController *)activityViewController
{
  return [NSString string];
}

- (id)activityViewController:(UIActivityViewController *)activityViewController itemForActivityType:(NSString *)activityType
{
  NSString * textToShare;
  if ([activityType isEqualToString:UIActivityTypeMail])
    textToShare = L(self.info[@"NotificationLocalizedShareEmailBodyKey"]);
  else
    textToShare = L(self.info[@"NotificationLocalizedShareTextKey"]);
  NSURL * link = [NSURL URLWithString:self.info[@"NotificationShareLink"]];
  if (link)
    textToShare = [textToShare stringByAppendingFormat:@" %@", [link absoluteString]];
  return textToShare;
}

- (NSString *)activityViewController:(UIActivityViewController *)activityViewController subjectForActivityType:(NSString *)activityType
{
  NSString * emailSubject = L(self.info[@"NotificationLocalizedShareEmailSubjectKey"]);
  return emailSubject;
}

@end