1 |
efrain |
1 |
/*
|
|
|
2 |
* Copyright 2019 Google
|
|
|
3 |
*
|
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
5 |
* you may not use this file except in compliance with the License.
|
|
|
6 |
* You may obtain a copy of the License at
|
|
|
7 |
*
|
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
9 |
*
|
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
13 |
* See the License for the specific language governing permissions and
|
|
|
14 |
* limitations under the License.
|
|
|
15 |
*/
|
|
|
16 |
|
|
|
17 |
#import "Interop/Analytics/Public/FIRAnalyticsInterop.h"
|
|
|
18 |
|
|
|
19 |
NS_ASSUME_NONNULL_BEGIN
|
|
|
20 |
|
|
|
21 |
static NSString *const kAnalyticsOriginPersonalization = @"fp";
|
|
|
22 |
|
|
|
23 |
static NSString *const kExternalEvent = @"personalization_assignment";
|
|
|
24 |
static NSString *const kExternalRcParameterParam = @"arm_key";
|
|
|
25 |
static NSString *const kExternalArmValueParam = @"arm_value";
|
|
|
26 |
static NSString *const kPersonalizationId = @"personalizationId";
|
|
|
27 |
static NSString *const kExternalPersonalizationIdParam = @"personalization_id";
|
|
|
28 |
static NSString *const kArmIndex = @"armIndex";
|
|
|
29 |
static NSString *const kExternalArmIndexParam = @"arm_index";
|
|
|
30 |
static NSString *const kGroup = @"group";
|
|
|
31 |
static NSString *const kExternalGroupParam = @"group";
|
|
|
32 |
|
|
|
33 |
static NSString *const kInternalEvent = @"_fpc";
|
|
|
34 |
static NSString *const kChoiceId = @"choiceId";
|
|
|
35 |
static NSString *const kInternalChoiceIdParam = @"_fpid";
|
|
|
36 |
|
|
|
37 |
@interface RCNPersonalization : NSObject
|
|
|
38 |
|
|
|
39 |
/// Analytics connector
|
|
|
40 |
@property(nonatomic, strong) id<FIRAnalyticsInterop> _Nullable analytics;
|
|
|
41 |
|
|
|
42 |
@property(atomic, strong) NSMutableDictionary *loggedChoiceIds;
|
|
|
43 |
|
|
|
44 |
- (instancetype)init NS_UNAVAILABLE;
|
|
|
45 |
|
|
|
46 |
/// Designated initializer.
|
|
|
47 |
- (instancetype)initWithAnalytics:(id<FIRAnalyticsInterop> _Nullable)analytics
|
|
|
48 |
NS_DESIGNATED_INITIALIZER;
|
|
|
49 |
|
|
|
50 |
/// Called when an arm is pulled from Remote Config. If the arm is personalized, log information to
|
|
|
51 |
/// Google in another thread.
|
|
|
52 |
- (void)logArmActive:(NSString *)rcParameter config:(NSDictionary *)config;
|
|
|
53 |
|
|
|
54 |
@end
|
|
|
55 |
|
|
|
56 |
NS_ASSUME_NONNULL_END
|