From 57a993c1049e5225dd330c964a46f9773afcfd11 Mon Sep 17 00:00:00 2001 From: Nelson Lopes da Silva <5671236+nflsilva@users.noreply.github.com> Date: Thu, 11 Jan 2024 11:49:20 +0000 Subject: [PATCH] RMET-2732 ::: Merge development with latest ecommerce features (#31) * RMET-2112 FB Analytics - Return user's response to App Tracking Transparency prompt (#22) * fix: add function for requestTrackingAuthorization without promise References: https://outsystemsrd.atlassian.net/browse/RMET-2112 * fix: fixing function structure * test: testing with promise * test: testing with only 1 export * test: use module.exports * refactor: remove commented lines * chore: update changelog References: https://outsystemsrd.atlassian.net/browse/RMET-2112 * refactor: use constant * RMET-2441 :: raise firebase-core version (#24) * feat: raise firebase core version * chore(release): raise to version 5.0.0-OS10 * RMET-2729 ::: JavaScript ::: Log e-commerce events (#26) * feat: added logECommerceEvent javascript function * chore: updates CHANGELOG.md * feat: changed how ecommerce arguments are passed to the native side * feat: Add E-Commerce Events Logging on iOS (#27) Implement the logic required to perform e-commerce event logging. The implementation is similar to the already existing logEvent but without any parameter number constraints. Before logging, and considering that the Firebase Analytics library doesn't return any kind of error in case of any issues with the data, the implementation performs the following steps: #1 - Flat the Key-Value pair information to a JSON Object. This is done on both Event Parameters and Items. #2 - Validate if the event parameters and items are correctly constructed. Both validations are done isolated, with errors being handled and returned in case of occurrence. #3 - Validate the event parameters and items are valid according to the event name. This time, the validation is done altogether, with errors being handled and returned in case of occurrence. #4 - Merge event parameters and items into a single JSON object to be sent to Analytics for logging purposes. The implementation, since it's done using Swift, involves adding the Swift dependency to the `plugin.xml`. References: https://outsystemsrd.atlassian.net/browse/RMET-2731 * fix: Adjust Validations (#29) Remove the default `quantity` value as this is already assured by Firebase. Fix the `item_list_id` and `item_list_name` as only the property set on the event parameters should be removed and not both always. File rename to match the structure name. References: https://outsystemsrd.atlassian.net/browse/RMET-2731 * RMET-2730 ::: Android ::: E-Commerce events (#28) * feat: added ecommerce events first version * fix: added removed hook * fix: fixed bugs with happy paths * feat: added KDoc * fix: removed unecessry verification * chore: updated CHANGELOG * fix: applied changes suggested on the PR comments * fix: added missing bridge file * fix: applied proposed changes * fix: fixed class name (#30) * chore(release): bump version to 5.0.0-OS11 --------- Co-authored-by: Alexandre Jacinto Co-authored-by: Marta Carlos <101343976+OS-martacarlos@users.noreply.github.com> Co-authored-by: Ricardo Silva <97543217+OS-ricardomoreirasilva@users.noreply.github.com> --- CHANGELOG.md | 11 ++ package.json | 2 +- plugin.xml | 40 ++++- .../analytics}/FirebaseAnalyticsPlugin.java | 24 ++- .../firebase/analytics/OSFANLManager.kt | 160 ++++++++++++++++++ .../analytics/model/OSFANLBundle+putAny.kt | 17 ++ .../analytics/model/OSFANLDefaultValues.kt | 12 ++ .../firebase/analytics/model/OSFANLError.kt | 88 ++++++++++ .../analytics/model/OSFANLEventOutputModel.kt | 14 ++ .../model/OSFANLInputDataFieldKey.kt | 25 +++ .../model/OSFANLJSONArray+extension.kt | 23 +++ .../validator/OSFANLEventItemsValidator.kt | 119 +++++++++++++ .../OSFANLEventParameterValidator.kt | 105 ++++++++++++ .../validator/OSFANLMinimumRequired.kt | 8 + .../Common/Extensions/StringConvertable.swift | 20 +++ src/ios/Common/OSFANLDefaultValues.swift | 4 + src/ios/Common/OSFANLError.swift | 45 +++++ src/ios/Common/OSFANLInputDataFieldKey.swift | 17 ++ src/ios/FirebaseAnalyticsPlugin.h | 1 + src/ios/FirebaseAnalyticsPlugin.m | 34 ++++ .../OSFANLInputTransformable.swift | 3 + .../OSFANLInputTransformableModel.swift | 9 + .../OSFANLInputTransformer.swift | 84 +++++++++ src/ios/Manager/OSFANLManageable.swift | 17 ++ .../OSFANLManager+EventValidationRules.swift | 126 ++++++++++++++ src/ios/Manager/OSFANLManager.swift | 42 +++++ src/ios/Manager/OSFANLManagerFactory.swift | 7 + src/ios/Manager/OSFANLOutputModel.swift | 9 + src/ios/Validator/OSFANLEventValidator.swift | 12 ++ www/FirebaseAnalytics.js | 4 + 30 files changed, 1072 insertions(+), 10 deletions(-) rename src/android/{ => com/outsystems/firebase/analytics}/FirebaseAnalyticsPlugin.java (79%) create mode 100644 src/android/com/outsystems/firebase/analytics/OSFANLManager.kt create mode 100644 src/android/com/outsystems/firebase/analytics/model/OSFANLBundle+putAny.kt create mode 100644 src/android/com/outsystems/firebase/analytics/model/OSFANLDefaultValues.kt create mode 100644 src/android/com/outsystems/firebase/analytics/model/OSFANLError.kt create mode 100644 src/android/com/outsystems/firebase/analytics/model/OSFANLEventOutputModel.kt create mode 100644 src/android/com/outsystems/firebase/analytics/model/OSFANLInputDataFieldKey.kt create mode 100644 src/android/com/outsystems/firebase/analytics/model/OSFANLJSONArray+extension.kt create mode 100644 src/android/com/outsystems/firebase/analytics/validator/OSFANLEventItemsValidator.kt create mode 100644 src/android/com/outsystems/firebase/analytics/validator/OSFANLEventParameterValidator.kt create mode 100644 src/android/com/outsystems/firebase/analytics/validator/OSFANLMinimumRequired.kt create mode 100644 src/ios/Common/Extensions/StringConvertable.swift create mode 100644 src/ios/Common/OSFANLDefaultValues.swift create mode 100644 src/ios/Common/OSFANLError.swift create mode 100644 src/ios/Common/OSFANLInputDataFieldKey.swift create mode 100644 src/ios/InputTransformer/OSFANLInputTransformable.swift create mode 100644 src/ios/InputTransformer/OSFANLInputTransformableModel.swift create mode 100644 src/ios/InputTransformer/OSFANLInputTransformer.swift create mode 100644 src/ios/Manager/OSFANLManageable.swift create mode 100644 src/ios/Manager/OSFANLManager+EventValidationRules.swift create mode 100644 src/ios/Manager/OSFANLManager.swift create mode 100644 src/ios/Manager/OSFANLManagerFactory.swift create mode 100644 src/ios/Manager/OSFANLOutputModel.swift create mode 100644 src/ios/Validator/OSFANLEventValidator.swift diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a26da2f..9a55312e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,17 @@ The changes documented here do not include those from the original repository. ## [Unreleased] +## 5.0.0-OS11 + +### 2023-12-22 +- Feat: add new e-commerce logging method on Android (https://outsystemsrd.atlassian.net/browse/RMET-2730). + +### 2023-12-18 +- Feat: Implement e-commerce logging on iOS (https://outsystemsrd.atlassian.net/browse/RMET-2731). + +### 2023-12-13 +- Feat: add new e-commerce logging method (https://outsystemsrd.atlassian.net/browse/RMET-2729). + ## 5.0.0-OS10 ### 2023-08-11 diff --git a/package.json b/package.json index 436a8259..1970cbbf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-firebase-analytics", - "version": "5.0.0-OS10", + "version": "5.0.0-OS11", "description": "Cordova plugin for Firebase Analytics", "cordova": { "id": "cordova-plugin-firebase-analytics", diff --git a/plugin.xml b/plugin.xml index dbe8aaa8..40492481 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,7 +1,7 @@ + version="5.0.0-OS11"> FirebaseAnalyticsPlugin Cordova plugin for Firebase Analytics @@ -38,6 +38,8 @@ xmlns:android="http://schemas.android.com/apk/res/android" + +