-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Standardize support for Firebase products that integrate with Remote Config. #7094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
91a5f0b
aa69e72
820ad6b
e5b90f7
e929711
41439fc
89e4aed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ - (instancetype)initWithAnalytics:(id<FIRAnalyticsInterop> _Nullable)analytics { | |
| self = [super init]; | ||
| if (self) { | ||
| self->_analytics = analytics; | ||
| self->_armsCache = [[NSMutableDictionary alloc] init]; | ||
| } | ||
| return self; | ||
| } | ||
|
|
@@ -37,16 +38,35 @@ - (void)logArmActive:(NSString *)key config:(NSDictionary *)config { | |
| } | ||
|
|
||
| NSDictionary *metadata = ids[key]; | ||
| if (!metadata || metadata[kPersonalizationId] == nil) { | ||
| if (!metadata) { | ||
| return; | ||
| } | ||
|
|
||
| NSString *personalizationId = metadata[kPersonalizationId]; | ||
vic-flair marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if (personalizationId == nil) { | ||
| return; | ||
| } | ||
|
|
||
| // This gets dispatched to a serial queue, so this is OK. But even if not, it'll just possibly | ||
|
||
| // log more. | ||
| if (self->_armsCache[key] == personalizationId) { | ||
|
||
| return; | ||
| } | ||
| self->_armsCache[key] = personalizationId; | ||
|
|
||
| [self->_analytics logEventWithOrigin:kAnalyticsOriginPersonalization | ||
| name:kAnalyticsPullEvent | ||
| parameters:@{ | ||
| kArmKey : metadata[kPersonalizationId], | ||
| kArmValue : values[key].stringValue | ||
| kArmKey : key, | ||
| kArmValue : values[key].stringValue, | ||
| kPersonalizationIdKey : personalizationId, | ||
| kArmIndexKey : metadata[kArmIndex], | ||
| kGroup : metadata[kGroup] | ||
|
||
| }]; | ||
|
|
||
| [self->_analytics logEventWithOrigin:kAnalyticsOriginPersonalization | ||
| name:kAnalyticsPullEventInternal | ||
| parameters:@{kChoiceIdKey : metadata[kChoiceId]}]; | ||
| } | ||
|
|
||
| @end | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: as I commented on the Android change, it's unclear to me what "pull" means here and below.
Also, given this whole file concerns logging to Analytics, including "Analytics" in some field names, but not others is confusing. I'd vote to just omit it.
The main distinctions from my perspective are internal vs external, and "event" vs "param" (to use Analytics' "feature type" nomenclature from the event proposal).
To summarize, I'd vote to use "internal" and "external" prefixes to differentiate internal from external events, and "event" and "param" suffixes to differentiate event names from param names, eg
kInternalEvent,kInternalChoiceIdParam, etcThinking (no action req'd): all these field names are consistent across Android and iOS 👍