UNPKG

1.57 kBPlain TextView Raw
1//
2// BranchLinkProperties+RNBranch.m
3// RNBranch
4//
5// Created by Jimmy Dee on 1/26/17.
6// Copyright © 2017 Branch Metrics. All rights reserved.
7//
8
9#import "BranchLinkProperties+RNBranch.h"
10#import "NSObject+RNBranch.h"
11#import "RNBranchProperty.h"
12
13@implementation BranchLinkProperties(RNBranch)
14
15+ (NSDictionary<NSString *,RNBranchProperty *> *)supportedProperties
16{
17 static NSDictionary<NSString *, RNBranchProperty *> *_linkProperties;
18 static dispatch_once_t once = 0;
19 dispatch_once(&once, ^{
20 _linkProperties =
21 @{
22 @"alias": [RNBranchProperty propertyWithSetterSelector:@selector(setAlias:) type:NSString.class],
23 @"campaign": [RNBranchProperty propertyWithSetterSelector:@selector(setCampaign:) type:NSString.class],
24 @"channel": [RNBranchProperty propertyWithSetterSelector:@selector(setChannel:) type:NSString.class],
25 // @"duration": [RNBranchProperty propertyWithSetterSelector:@selector(setMatchDuration:) type:NSNumber.class], // deprecated
26 @"feature": [RNBranchProperty propertyWithSetterSelector:@selector(setFeature:) type:NSString.class],
27 @"stage": [RNBranchProperty propertyWithSetterSelector:@selector(setStage:) type:NSString.class],
28 @"tags": [RNBranchProperty propertyWithSetterSelector:@selector(setTags:) type:NSArray.class]
29 };
30 });
31
32 return _linkProperties;
33}
34
35- (instancetype)initWithMap:(NSDictionary *)map
36{
37 self = [self init];
38 if (self) {
39 [self setSupportedPropertiesWithMap:map];
40 }
41 return self;
42}
43
44@end