Skip to content

Commit a669d64

Browse files
authored
Add product_id to GoogleDataTransport logging for compliance. (#12143)
1 parent 671a878 commit a669d64

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

FirebaseMessaging.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ device, and it is completely free.
6464
s.dependency 'GoogleUtilities/Reachability', '~> 7.8'
6565
s.dependency 'GoogleUtilities/Environment', '~> 7.8'
6666
s.dependency 'GoogleUtilities/UserDefaults', '~> 7.8'
67-
s.dependency 'GoogleDataTransport', '~> 9.2'
67+
s.dependency 'GoogleDataTransport', '~> 9.3'
6868
s.dependency 'nanopb', '>= 2.30908.0', '< 2.30910.0'
6969

7070
s.test_spec 'unit' do |unit_tests|

FirebaseMessaging/Sources/FIRMessagingConstants.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ FOUNDATION_EXPORT NSString *const kFIRMessagingFID;
3333
FOUNDATION_EXPORT NSString *const kFIRMessagingAnalyticsComposerIdentifier;
3434
FOUNDATION_EXPORT NSString *const kFIRMessagingAnalyticsMessageLabel;
3535
FOUNDATION_EXPORT NSString *const kFIRMessagingAnalyticsComposerLabel;
36+
FOUNDATION_EXPORT NSString *const kFIRMessagingProductID;
3637

3738
FOUNDATION_EXPORT NSString *const kFIRMessagingRemoteNotificationsProxyEnabledInfoPlistKey;
3839
FOUNDATION_EXPORT NSString *const kFIRMessagingSubDirectoryName;

FirebaseMessaging/Sources/FIRMessagingConstants.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
NSString *const kFIRMessagingAnalyticsComposerIdentifier = @"google.c.a.c_id";
4444
NSString *const kFIRMessagingAnalyticsMessageLabel = @"google.c.a.m_l";
4545
NSString *const kFIRMessagingAnalyticsComposerLabel = @"google.c.a.c_l";
46+
NSString *const kFIRMessagingProductID = @"google.product_id";
4647

4748
NSString *const kFIRMessagingRemoteNotificationsProxyEnabledInfoPlistKey =
4849
@"FirebaseAppDelegateProxyEnabled";

FirebaseMessaging/Sources/FIRMessagingExtensionHelper.m

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,14 @@ - (void)exportDeliveryMetricsToBigQueryWithMessageInfo:(NSDictionary *)info {
266266
FIRMessagingMetricsLog *log =
267267
[[FIRMessagingMetricsLog alloc] initWithEventExtension:eventExtension];
268268

269-
GDTCOREvent *event = [transport eventForTransport];
269+
GDTCOREvent *event;
270+
if (info[kFIRMessagingProductID]) {
271+
int32_t productID = [info[kFIRMessagingProductID] intValue];
272+
GDTCORProductData *productData = [[GDTCORProductData alloc] initWithProductID:productID];
273+
event = [transport eventForTransportWithProductData:productData];
274+
} else {
275+
event = [transport eventForTransport];
276+
}
270277
event.dataObject = log;
271278
event.qosTier = GDTCOREventQoSFast;
272279

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ let package = Package(
150150
googleAppMeasurementDependency(),
151151
.package(
152152
url: "https://github.com/google/GoogleDataTransport.git",
153-
"9.2.0" ..< "10.0.0"
153+
"9.3.0" ..< "10.0.0"
154154
),
155155
.package(
156156
url: "https://github.com/google/GoogleUtilities.git",

0 commit comments

Comments
 (0)