From 9e63a11bc2e955effdb94fd8f1fa095fffdad096 Mon Sep 17 00:00:00 2001 From: Niall Brennan Date: Wed, 28 Aug 2019 23:14:55 +0100 Subject: [PATCH 1/7] add promotion viewed event (#46) --- Example/Tests/Tests.m | 24 +++++++++++++++++++ .../Classes/SEGFirebaseIntegration.m | 1 + 2 files changed, 25 insertions(+) diff --git a/Example/Tests/Tests.m b/Example/Tests/Tests.m index b31be92..407c345 100644 --- a/Example/Tests/Tests.m +++ b/Example/Tests/Tests.m @@ -306,6 +306,30 @@ describe(@"Firebase Integration", ^{ }]; }); + it(@"track Promotion Viewed", ^{ + SEGTrackPayload *payload = [[SEGTrackPayload alloc] initWithEvent:@"Promotion Viewed" + properties:@{ + @"product_id" : @"507f1f77bcf86cd799439011", + @"category" : @"Games", + @"name" : @"Monopoly 3rd Edition", + @"price" : @18.99, + @"quantity" : @1, + @"currency" : @"usd", + } + context:@{} + integrations:@{}]; + + [integration track:payload]; + [verify(mockFirebase) logEventWithName:@"present_offer" parameters:@{ + @"item_id" : @"507f1f77bcf86cd799439011", + @"item_category" : @"Games", + @"item_name" : @"Monopoly 3rd Edition", + @"price" : @18.99, + @"quantity" : @1, + @"currency" : @"usd", + }]; + }); + it(@"track Payment Info Entered", ^{ SEGTrackPayload *payload = [[SEGTrackPayload alloc] initWithEvent:@"Payment Info Entered" properties:@{ diff --git a/Segment-Firebase/Classes/SEGFirebaseIntegration.m b/Segment-Firebase/Classes/SEGFirebaseIntegration.m index 9df693d..b9f651e 100644 --- a/Segment-Firebase/Classes/SEGFirebaseIntegration.m +++ b/Segment-Firebase/Classes/SEGFirebaseIntegration.m @@ -76,6 +76,7 @@ kFIREventAddToCart, @"Product Added", kFIREventRemoveFromCart, @"Product Removed", kFIREventBeginCheckout, @"Checkout Started", + kFIREventPresentOffer, @"Promotion Viewed", kFIREventAddPaymentInfo, @"Payment Info Entered", kFIREventEcommercePurchase, @"Order Completed", kFIREventPurchaseRefund, @"Order Refunded", From 9d22de9b4894c6933e5282f7207ddeb60dd923b3 Mon Sep 17 00:00:00 2001 From: Brie Date: Wed, 28 Aug 2019 15:18:14 -0700 Subject: [PATCH 2/7] Prepare for release 2.4.1 --- CHANGELOG.md | 5 +++++ Segment-Firebase.podspec | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b1bd33..e661ffe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Change Log ========== +Version 2.4.1 *(28th August, 2018)* +------------------------------------------- + +* Add mapping of Segment `"Promotion Viewed"` event to Firebase `kFIREventPresentOffer` event. + Version 2.4.0 *(26th September, 2018)* ------------------------------------------- *(Supports analytics-ios 3.2.+ and Firebase 5.0+)* diff --git a/Segment-Firebase.podspec b/Segment-Firebase.podspec index 88526c6..717c017 100644 --- a/Segment-Firebase.podspec +++ b/Segment-Firebase.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Segment-Firebase" - s.version = "2.4.0" + s.version = "2.4.1" s.summary = "Firebase Integration for Segment's analytics-ios library." s.description = <<-DESC From 00850a156faef4010525b854df7885a6779c29cc Mon Sep 17 00:00:00 2001 From: Niall Brennan Date: Tue, 3 Sep 2019 17:15:00 +0100 Subject: [PATCH 3/7] Update CHANGELOG.md fix year typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e661ffe..8d74bd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ Change Log ========== -Version 2.4.1 *(28th August, 2018)* +Version 2.4.1 *(28th August, 2019)* ------------------------------------------- * Add mapping of Segment `"Promotion Viewed"` event to Firebase `kFIREventPresentOffer` event. From 402f24c9847ab8e1c688b7de6adc184342c521ec Mon Sep 17 00:00:00 2001 From: Brie McNally <31782219+briemcnally@users.noreply.github.com> Date: Mon, 9 Sep 2019 16:46:37 -0700 Subject: [PATCH 4/7] Brie/updates sunset (#47) * Add changes to stop crash and format event names and params * Add unit tests for event names and params separated by periods * Update dependencies of FirebaseCore and FirebaseAnalytics to most recent versions * Add circleci config * Update files for pod update' * Update xcode version for ci tests * Change xcode version * Remove IDEWorksapceChecks.plist * Account for leading and trailing whitespace * Add unit tests for leading and trailing whitespace --- .circleci/config.yml | 33 +++++ Example/Podfile.lock | 123 +++++++++++------- Example/Tests/Tests.m | 28 ++++ Segment-Firebase.podspec | 3 +- .../Classes/SEGFirebaseIntegration.m | 35 ++++- circle.yml | 19 --- 6 files changed, 168 insertions(+), 73 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 circle.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..7ae13b6 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,33 @@ +version: 2 + +jobs: + build_and_test: + macos: + xcode: "10.2.1" + steps: + - checkout + - run: xcrun simctl list + - run: + name: Install build dependencies + command: | + sudo gem install xcpretty + sudo gem install cocoapods -v 1.6.1 + # - run: + # name: Fetch Cocoapods specs + # command: curl https://cocoapods-specs.circleci.com/fetch-cocoapods-repo-from-s3.sh | bash -s cf + + - run: make install + - run: make build + - run: make test + - run: make lint + + # - store_test_results: + # # relies on xcpretty --report junit + # path: build/reports + # - run: bash <(curl -s https://codecov.io/bash) + +workflows: + version: 2 + build_and_test: + jobs: + - build_and_test diff --git a/Example/Podfile.lock b/Example/Podfile.lock index abfca8a..17a0985 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,65 +1,80 @@ PODS: - Analytics (3.6.9) - Expecta (1.0.6) - - Firebase/Core (5.9.0): + - Firebase/Core (6.7.0): - Firebase/CoreOnly - - FirebaseAnalytics (= 5.2.0) - - Firebase/CoreOnly (5.9.0): - - FirebaseCore (= 5.1.4) - - FirebaseAnalytics (5.2.0): - - FirebaseCore (~> 5.1) - - FirebaseInstanceID (~> 3.2) - - GoogleAppMeasurement (~> 5.2) - - GoogleUtilities/AppDelegateSwizzler (~> 5.2) - - GoogleUtilities/MethodSwizzler (~> 5.2) - - GoogleUtilities/Network (~> 5.2) - - "GoogleUtilities/NSData+zlib (~> 5.2)" + - FirebaseAnalytics (= 6.1.1) + - Firebase/CoreOnly (6.7.0): + - FirebaseCore (= 6.2.1) + - FirebaseAnalytics (6.1.1): + - FirebaseCore (~> 6.2) + - FirebaseInstanceID (~> 4.2) + - GoogleAppMeasurement (= 6.1.1) + - GoogleUtilities/AppDelegateSwizzler (~> 6.0) + - GoogleUtilities/MethodSwizzler (~> 6.0) + - GoogleUtilities/Network (~> 6.0) + - "GoogleUtilities/NSData+zlib (~> 6.0)" - nanopb (~> 0.3) - - FirebaseCore (5.1.4): - - GoogleUtilities/Logger (~> 5.2) - - FirebaseInstanceID (3.2.2): - - FirebaseCore (~> 5.1) - - GoogleUtilities/Environment (~> 5.3) - - GoogleUtilities/UserDefaults (~> 5.3) - - GoogleAppMeasurement (5.2.0): - - GoogleUtilities/AppDelegateSwizzler (~> 5.2) - - GoogleUtilities/MethodSwizzler (~> 5.2) - - GoogleUtilities/Network (~> 5.2) - - "GoogleUtilities/NSData+zlib (~> 5.2)" + - FirebaseCore (6.2.1): + - FirebaseCoreDiagnostics (~> 1.0) + - FirebaseCoreDiagnosticsInterop (~> 1.0) + - GoogleUtilities/Environment (~> 6.2) + - GoogleUtilities/Logger (~> 6.2) + - FirebaseCoreDiagnostics (1.0.1): + - FirebaseCoreDiagnosticsInterop (~> 1.0) + - GoogleDataTransportCCTSupport (~> 1.0) + - GoogleUtilities/Environment (~> 6.2) + - GoogleUtilities/Logger (~> 6.2) + - FirebaseCoreDiagnosticsInterop (1.0.0) + - FirebaseInstanceID (4.2.3): + - FirebaseCore (~> 6.0) + - GoogleUtilities/Environment (~> 6.0) + - GoogleUtilities/UserDefaults (~> 6.0) + - GoogleAppMeasurement (6.1.1): + - GoogleUtilities/AppDelegateSwizzler (~> 6.0) + - GoogleUtilities/MethodSwizzler (~> 6.0) + - GoogleUtilities/Network (~> 6.0) + - "GoogleUtilities/NSData+zlib (~> 6.0)" - nanopb (~> 0.3) - - GoogleUtilities/AppDelegateSwizzler (5.3.0): + - GoogleDataTransport (1.1.3) + - GoogleDataTransportCCTSupport (1.0.2): + - GoogleDataTransport (~> 1.1) + - nanopb + - GoogleUtilities/AppDelegateSwizzler (6.2.5): - GoogleUtilities/Environment - GoogleUtilities/Logger - GoogleUtilities/Network - - GoogleUtilities/Environment (5.3.0) - - GoogleUtilities/Logger (5.3.0): + - GoogleUtilities/Environment (6.2.5) + - GoogleUtilities/Logger (6.2.5): - GoogleUtilities/Environment - - GoogleUtilities/MethodSwizzler (5.3.0): + - GoogleUtilities/MethodSwizzler (6.2.5): - GoogleUtilities/Logger - - GoogleUtilities/Network (5.3.0): + - GoogleUtilities/Network (6.2.5): - GoogleUtilities/Logger - "GoogleUtilities/NSData+zlib" - GoogleUtilities/Reachability - - "GoogleUtilities/NSData+zlib (5.3.0)" - - GoogleUtilities/Reachability (5.3.0): + - "GoogleUtilities/NSData+zlib (6.2.5)" + - GoogleUtilities/Reachability (6.2.5): - GoogleUtilities/Logger - - GoogleUtilities/UserDefaults (5.3.0): + - GoogleUtilities/UserDefaults (6.2.5): - GoogleUtilities/Logger - - nanopb (0.3.8): - - nanopb/decode (= 0.3.8) - - nanopb/encode (= 0.3.8) - - nanopb/decode (0.3.8) - - nanopb/encode (0.3.8) + - nanopb (0.3.901): + - nanopb/decode (= 0.3.901) + - nanopb/encode (= 0.3.901) + - nanopb/decode (0.3.901) + - nanopb/encode (0.3.901) - OCHamcrest (7.0.1) - OCMockito (5.0.0): - OCHamcrest (~> 7.0) - - Segment-Firebase (2.3.0): + - Segment-Firebase (2.4.1): - Analytics (~> 3.2) - - Firebase/Core (~> 5.0) - - Segment-Firebase/Core (= 2.3.0) - - Segment-Firebase/Core (2.3.0): + - Firebase/Core (~> 6.2) + - FirebaseAnalytics (~> 6.1) + - Segment-Firebase/Core (= 2.4.1) + - Segment-Firebase/Core (2.4.1): - Analytics (~> 3.2) - - Firebase/Core (~> 5.0) + - Firebase/Core (~> 6.2) + - FirebaseAnalytics (~> 6.1) - Specta (1.0.7) DEPENDENCIES: @@ -75,8 +90,12 @@ SPEC REPOS: - Firebase - FirebaseAnalytics - FirebaseCore + - FirebaseCoreDiagnostics + - FirebaseCoreDiagnosticsInterop - FirebaseInstanceID - GoogleAppMeasurement + - GoogleDataTransport + - GoogleDataTransportCCTSupport - GoogleUtilities - nanopb - OCHamcrest @@ -90,18 +109,22 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Analytics: 6541ce337e99d9f7a2240a8b3953940a7be5f998 Expecta: 3b6bd90a64b9a1dcb0b70aa0e10a7f8f631667d5 - Firebase: 383fa29aca93e371cab776b48a5c66544d3c2003 - FirebaseAnalytics: 831f1f127f4a75698e9875a87bf7e2668730d953 - FirebaseCore: 2a84b6b325792a4319ef71ee18819dcba08d2fd7 - FirebaseInstanceID: 78ba376fcd5b94c001f9999b2cbd3d1f1e56e78d - GoogleAppMeasurement: 2b3a023a61239c8d002e6e4fcf4abce8eddce0e0 - GoogleUtilities: 760ccb53b7c7f40f9c02d8c241f76f841a7a6162 - nanopb: 5601e6bca2dbf1ed831b519092ec110f66982ca3 + Firebase: 291d7b0a7b393f252358083b5d224884126fa46d + FirebaseAnalytics: 843c7f64a8f9c79f0d03281197ebe7bb1d58d477 + FirebaseCore: 32b48f41c84a56fbde73b35ed01a830b3b6dc048 + FirebaseCoreDiagnostics: 4c04ae09d0ab027c30179828c6bb47764df1bd13 + FirebaseCoreDiagnosticsInterop: 6829da2b8d1fc795ff1bd99df751d3788035d2cb + FirebaseInstanceID: 8b42755db950682e7de0d167bc6fb26a57b244af + GoogleAppMeasurement: 86a82f0e1f20b8eedf8e20326530138fd71409de + GoogleDataTransport: 91e682bd60a49d3f8f69f2e909a66efaed5a1e7a + GoogleDataTransportCCTSupport: 6b545f7149111180763dc18c6f372c963de4a310 + GoogleUtilities: e7dc37039b19df7fe543479d3e4a02ac8d11bb69 + nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48 OCHamcrest: 7c2229e7ea96eecd6e43dbef7c68e1dfbd6928b8 OCMockito: 2598f5d43f6e74964d3ec3b9dea8b4fde3ea2c43 - Segment-Firebase: 804d7e63849ad42cc44dcbdb91ad080fa4edfb3c + Segment-Firebase: d882b05c4fa34513f1f950623d876bc6acc02740 Specta: 3e1bd89c3517421982dc4d1c992503e48bd5fe66 PODFILE CHECKSUM: 256b940a1c5273be6ea8930b511feb0a3fb065f8 -COCOAPODS: 1.5.3 +COCOAPODS: 1.7.3 diff --git a/Example/Tests/Tests.m b/Example/Tests/Tests.m index 407c345..8de4fc4 100644 --- a/Example/Tests/Tests.m +++ b/Example/Tests/Tests.m @@ -65,6 +65,34 @@ describe(@"Firebase Integration", ^{ @"Starship_Type" : @"Death Star" }]; }); + + it(@"track with event name and parmas separated by periods", ^{ + SEGTrackPayload *payload = [[SEGTrackPayload alloc] initWithEvent:@"Starship.Ordered" + properties:@{ + @"Starship.Type" : @"Death Star" + } + context:@{} + integrations:@{}]; + + [integration track:payload]; + [verify(mockFirebase) logEventWithName:@"Starship_Ordered" parameters:@{ + @"Starship_Type" : @"Death Star" + }]; + }); + + it(@"track with leading and trailing spacing for event name", ^{ + SEGTrackPayload *payload = [[SEGTrackPayload alloc] initWithEvent:@" Starship Ordered " + properties:@{ + @"Starship.Type" : @"Death Star" + } + context:@{} + integrations:@{}]; + + [integration track:payload]; + [verify(mockFirebase) logEventWithName:@"Starship_Ordered" parameters:@{ + @"Starship_Type" : @"Death Star" + }]; + }); it(@"track Order Completed", ^{ SEGTrackPayload *payload = [[SEGTrackPayload alloc] initWithEvent:@"Order Completed" properties:@{ diff --git a/Segment-Firebase.podspec b/Segment-Firebase.podspec index 717c017..1c0322c 100644 --- a/Segment-Firebase.podspec +++ b/Segment-Firebase.podspec @@ -24,7 +24,8 @@ Pod::Spec.new do |s| s.static_framework = true s.dependency 'Analytics', '~> 3.2' - s.dependency 'Firebase/Core', '~> 5.0' + s.dependency 'Firebase/Core', '~> 6.2' + s.dependency 'FirebaseAnalytics','~> 6.1' s.subspec 'Core' do |core| #For users who only want the core Firebase package diff --git a/Segment-Firebase/Classes/SEGFirebaseIntegration.m b/Segment-Firebase/Classes/SEGFirebaseIntegration.m index b9f651e..0eb1776 100644 --- a/Segment-Firebase/Classes/SEGFirebaseIntegration.m +++ b/Segment-Firebase/Classes/SEGFirebaseIntegration.m @@ -18,6 +18,11 @@ SEGLog(@"[FIROptions defaultOptions].deepLinkURLScheme = %@;", deepLinkURLScheme); } + if ([FIRApp defaultApp]) { + SEGLog(@"[FIRApp Configure] already called, skipping"); + return self; + } + [FIRApp configure]; SEGLog(@"[FIRApp Configure]"); } @@ -87,11 +92,28 @@ kFIREventSearch, @"Products Searched", nil]; NSString *mappedEvent = [mapper objectForKey:event]; - + NSArray *periodSeparatedEvent = [event componentsSeparatedByString:@"."]; + NSString *regexString = @"^[a-zA-Z0-9_]+$"; + NSError *error = NULL; + NSRegularExpression *regex = + [NSRegularExpression regularExpressionWithPattern:regexString + options:0 + error:&error]; + NSUInteger numberOfMatches = [regex numberOfMatchesInString:event + options:0 + range:NSMakeRange(0, [event length])]; if (mappedEvent) { return mappedEvent; + } else if (numberOfMatches == 0) { + NSString *trimmedEvent = [event stringByTrimmingCharactersInSet: + [NSCharacterSet whitespaceAndNewlineCharacterSet]]; + if ([periodSeparatedEvent count] > 1) { + return [trimmedEvent stringByReplacingOccurrencesOfString:@"." withString:@"_"]; + } else { + return [trimmedEvent stringByReplacingOccurrencesOfString:@" " withString:@"_"]; + } } else { - return [event stringByReplacingOccurrencesOfString:@" " withString:@"_"]; + return event; } } @@ -141,7 +163,14 @@ NSDictionary *formatEventProperties(NSDictionary *dictionary) NSMutableDictionary *output = [NSMutableDictionary dictionaryWithCapacity:dictionary.count]; [dictionary enumerateKeysAndObjectsUsingBlock:^(id key, id data, BOOL *stop) { [output removeObjectForKey:key]; - key = [key stringByReplacingOccurrencesOfString:@" " withString:@"_"]; + NSArray *periodSeparatedKey = [key componentsSeparatedByString:@"."]; + NSString *trimmedKey = [key stringByTrimmingCharactersInSet: + [NSCharacterSet whitespaceAndNewlineCharacterSet]]; + if ([periodSeparatedKey count] > 1) { + key = [trimmedKey stringByReplacingOccurrencesOfString:@"." withString:@"_"]; + } else { + key = [trimmedKey stringByReplacingOccurrencesOfString:@" " withString:@"_"]; + } if ([data isKindOfClass:[NSNumber class]]) { data = [NSNumber numberWithDouble:[data doubleValue]]; [output setObject:data forKey:key]; diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 12fc579..0000000 --- a/circle.yml +++ /dev/null @@ -1,19 +0,0 @@ -machine: - xcode: - version: "9.0" - -dependencies: - pre: - - gem install xcpretty - - gem install cocoapods -v 1.5.3 - override: - - make install - cache_directories: - - Example/Pods - - ~/.cocoapods - -test: - override: - - make build - - make test - - make lint From 4d4638d36a3b73c94b6c22d3d751d3e02b54e923 Mon Sep 17 00:00:00 2001 From: Brie Date: Mon, 9 Sep 2019 17:03:23 -0700 Subject: [PATCH 5/7] Prepare for releaae 2.5.0 --- CHANGELOG.md | 10 +++++++++- Segment-Firebase.podspec | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d74bd9..d82a01d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,18 @@ Change Log ========== +Version 2.5.0 *(9th September, 2019)* +------------------------------------------- + +* Updates to use the latest Firebase/Core SDK (6.2) +* Adds FirebaseAnalytics (6.1) as dependency as Firebase is migrating away from FirebaseCore +* Transforms event and property names to ^[a-zA-Z0-9_]+$ +* Fixes crash when Firebase SDK is instantiated multiple times by not configuring the FIRApp if already done +* Adds CircleCI config Version 2.4.1 *(28th August, 2019)* ------------------------------------------- -* Add mapping of Segment `"Promotion Viewed"` event to Firebase `kFIREventPresentOffer` event. +* Add mapping of Segment `"Promotion Viewed"` event to Firebase `kFIREventPresentOffer` event. Version 2.4.0 *(26th September, 2018)* ------------------------------------------- diff --git a/Segment-Firebase.podspec b/Segment-Firebase.podspec index 1c0322c..8f9c1c1 100644 --- a/Segment-Firebase.podspec +++ b/Segment-Firebase.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Segment-Firebase" - s.version = "2.4.1" + s.version = "2.5.0" s.summary = "Firebase Integration for Segment's analytics-ios library." s.description = <<-DESC From b2f40b8353e2f0570177b6a5584205792aaed07b Mon Sep 17 00:00:00 2001 From: Brie McNally <31782219+briemcnally@users.noreply.github.com> Date: Thu, 13 Feb 2020 17:31:22 -0800 Subject: [PATCH 6/7] Add support for screen calls (#48) --- Example/Tests/Tests.m | 17 +++++++++++++---- .../Classes/SEGFirebaseIntegration.m | 7 +++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Example/Tests/Tests.m b/Example/Tests/Tests.m index 8de4fc4..d49f9c7 100644 --- a/Example/Tests/Tests.m +++ b/Example/Tests/Tests.m @@ -65,7 +65,7 @@ describe(@"Firebase Integration", ^{ @"Starship_Type" : @"Death Star" }]; }); - + it(@"track with event name and parmas separated by periods", ^{ SEGTrackPayload *payload = [[SEGTrackPayload alloc] initWithEvent:@"Starship.Ordered" properties:@{ @@ -73,13 +73,13 @@ describe(@"Firebase Integration", ^{ } context:@{} integrations:@{}]; - + [integration track:payload]; [verify(mockFirebase) logEventWithName:@"Starship_Ordered" parameters:@{ @"Starship_Type" : @"Death Star" }]; }); - + it(@"track with leading and trailing spacing for event name", ^{ SEGTrackPayload *payload = [[SEGTrackPayload alloc] initWithEvent:@" Starship Ordered " properties:@{ @@ -87,7 +87,7 @@ describe(@"Firebase Integration", ^{ } context:@{} integrations:@{}]; - + [integration track:payload]; [verify(mockFirebase) logEventWithName:@"Starship_Ordered" parameters:@{ @"Starship_Type" : @"Death Star" @@ -555,6 +555,15 @@ describe(@"Firebase Integration", ^{ }]; }); + it(@"track screen with name", ^{ + SEGScreenPayload *payload = [[SEGScreenPayload alloc] initWithName:@"Home screen" + properties:@{} + context:@{} + integrations:@{}]; + [integration screen:payload]; + [verify(mockFirebase) setScreenName:@"Home screen" screenClass:nil]; + }); + }); SpecEnd diff --git a/Segment-Firebase/Classes/SEGFirebaseIntegration.m b/Segment-Firebase/Classes/SEGFirebaseIntegration.m index 0eb1776..21983ef 100644 --- a/Segment-Firebase/Classes/SEGFirebaseIntegration.m +++ b/Segment-Firebase/Classes/SEGFirebaseIntegration.m @@ -64,6 +64,13 @@ } +- (void)screen:(SEGScreenPayload *)payload +{ + [self.firebaseClass setScreenName:payload.name screenClass:nil]; + SEGLog(@"[FIRAnalytics setScreenName:%@]", payload.name); +} + + #pragma mark - Utilities // Event names can be up to 32 characters long, may only contain alphanumeric From f68d97c8078eda3f7f0d294c6afb1a6ffeb6f591 Mon Sep 17 00:00:00 2001 From: Brie Date: Thu, 13 Feb 2020 17:33:28 -0800 Subject: [PATCH 7/7] Prepare fore release 2.6.0 --- CHANGELOG.md | 4 ++++ Segment-Firebase.podspec | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d82a01d..ff591d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ Change Log ========== +Version 2.6.0 *(12th February, 2020)* +------------------------------------------- +* Adds support for calling `screen` calls explicitly. + Version 2.5.0 *(9th September, 2019)* ------------------------------------------- diff --git a/Segment-Firebase.podspec b/Segment-Firebase.podspec index 8f9c1c1..86388b5 100644 --- a/Segment-Firebase.podspec +++ b/Segment-Firebase.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Segment-Firebase" - s.version = "2.5.0" + s.version = "2.6.0" s.summary = "Firebase Integration for Segment's analytics-ios library." s.description = <<-DESC