diff --git a/androidHyperskillApp/Gemfile b/androidHyperskillApp/Gemfile index 2753581bde..9cfef91cf0 100644 --- a/androidHyperskillApp/Gemfile +++ b/androidHyperskillApp/Gemfile @@ -1,6 +1,6 @@ source "https://rubygems.org" ruby "3.1.0" -gem "fastlane", "2.214.0" +gem "fastlane", "2.215.1" eval_gemfile("fastlane/Pluginfile") diff --git a/androidHyperskillApp/Gemfile.lock b/androidHyperskillApp/Gemfile.lock index 1b38ee7a07..f3c8118543 100644 --- a/androidHyperskillApp/Gemfile.lock +++ b/androidHyperskillApp/Gemfile.lock @@ -8,8 +8,8 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) - aws-partitions (1.793.0) - aws-sdk-core (3.180.0) + aws-partitions (1.824.0) + aws-sdk-core (3.181.1) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.5) @@ -17,8 +17,8 @@ GEM aws-sdk-kms (1.71.0) aws-sdk-core (~> 3, >= 3.177.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.132.0) - aws-sdk-core (~> 3, >= 3.179.0) + aws-sdk-s3 (1.134.0) + aws-sdk-core (~> 3, >= 3.181.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.6) aws-sigv4 (1.6.0) @@ -36,7 +36,7 @@ GEM unf (>= 0.0.5, < 1.0.0) dotenv (2.8.1) emoji_regex (3.2.3) - excon (0.100.0) + excon (0.103.0) faraday (1.10.3) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) @@ -66,7 +66,7 @@ GEM faraday_middleware (1.2.0) faraday (~> 1.0) fastimage (2.2.7) - fastlane (2.214.0) + fastlane (2.215.1) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -87,6 +87,7 @@ GEM google-apis-playcustomapp_v1 (~> 0.1) google-cloud-storage (~> 1.31) highline (~> 2.0) + http-cookie (~> 1.0.5) json (< 3.0.0) jwt (>= 2.1.0, < 3) mini_magick (>= 4.9.4, < 5.0.0) @@ -98,7 +99,7 @@ GEM security (= 0.1.3) simctl (~> 1.6.3) terminal-notifier (>= 2.0.0, < 3.0.0) - terminal-table (>= 1.4.5, < 2.0.0) + terminal-table (~> 3) tty-screen (>= 0.6.3, < 1.0.0) tty-spinner (>= 0.8.0, < 1.0.0) word_wrap (~> 1.0.0) @@ -108,7 +109,7 @@ GEM fastlane-plugin-firebase_app_distribution (0.7.3) google-apis-firebaseappdistribution_v1 (~> 0.3.0) gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.46.0) + google-apis-androidpublisher_v3 (0.49.0) google-apis-core (>= 0.11.0, < 2.a) google-apis-core (0.11.1) addressable (~> 2.5, >= 2.5.1) @@ -184,8 +185,8 @@ GEM CFPropertyList naturally terminal-notifier (2.0.0) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) trailblazer-option (0.1.2) tty-cursor (0.7.1) tty-screen (0.8.1) @@ -195,7 +196,7 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.8.2) - unicode-display_width (1.8.0) + unicode-display_width (2.4.2) webrick (1.8.1) word_wrap (1.0.0) xcodeproj (1.22.0) @@ -216,7 +217,7 @@ PLATFORMS x86_64-linux DEPENDENCIES - fastlane (= 2.214.0) + fastlane (= 2.215.1) fastlane-plugin-firebase_app_distribution RUBY VERSION diff --git a/androidHyperskillApp/fastlane/Fastfile b/androidHyperskillApp/fastlane/Fastfile index ee375cf273..66cc357be0 100644 --- a/androidHyperskillApp/fastlane/Fastfile +++ b/androidHyperskillApp/fastlane/Fastfile @@ -1,4 +1,4 @@ -fastlane_version "2.214.0" +fastlane_version "2.215.1" default_platform(:android) @@ -62,6 +62,8 @@ platform :android do gradle_path: gradle_path, ) + ENV["SUPPLY_UPLOAD_MAX_RETRIES"] = "5" + upload_to_play_store( release_status: "completed", track: track, diff --git a/gradle/app.versions.toml b/gradle/app.versions.toml index d8ea1ad8dd..303f5c28a0 100644 --- a/gradle/app.versions.toml +++ b/gradle/app.versions.toml @@ -2,5 +2,5 @@ minSdk = '24' targetSdk = '33' compileSdk = '33' -versionName = '1.33' -versionCode = '189' \ No newline at end of file +versionName = '1.34' +versionCode = '192' \ No newline at end of file diff --git a/increment_build_number.sh b/increment_build_number.sh index 71af52481a..8acb78d1c6 100755 --- a/increment_build_number.sh +++ b/increment_build_number.sh @@ -50,6 +50,8 @@ CommitAndroidBuildNumber() { CommitIOSBuildNumber() { git add iosHyperskillApp/iosHyperskillApp/Info.plist + git add iosHyperskillApp/iosHyperskillAppTests/Info.plist + git add iosHyperskillApp/NotificationServiceExtension/Info.plist git add iosHyperskillApp/iosHyperskillApp.xcodeproj/project.pbxproj git commit -m "iOS: Bump build number" } @@ -57,6 +59,8 @@ CommitIOSBuildNumber() { CommitAndroidAndIOSBuildNumber() { git add gradle/app.versions.toml git add iosHyperskillApp/iosHyperskillApp/Info.plist + git add iosHyperskillApp/iosHyperskillAppTests/Info.plist + git add iosHyperskillApp/NotificationServiceExtension/Info.plist git add iosHyperskillApp/iosHyperskillApp.xcodeproj/project.pbxproj git commit -m "Bump build number" } diff --git a/iosHyperskillApp/NotificationServiceExtension/Info.plist b/iosHyperskillApp/NotificationServiceExtension/Info.plist index 57421ebf9b..3a43e2ae0d 100644 --- a/iosHyperskillApp/NotificationServiceExtension/Info.plist +++ b/iosHyperskillApp/NotificationServiceExtension/Info.plist @@ -2,6 +2,14 @@ + CFBundleDisplayName + NotificationServiceExtension + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleVersion + 191 + CFBundleShortVersionString + 1.34 NSExtension NSExtensionPointIdentifier diff --git a/iosHyperskillApp/iosHyperskillApp.xcodeproj/project.pbxproj b/iosHyperskillApp/iosHyperskillApp.xcodeproj/project.pbxproj index ef42fcc3eb..2378099e6f 100644 --- a/iosHyperskillApp/iosHyperskillApp.xcodeproj/project.pbxproj +++ b/iosHyperskillApp/iosHyperskillApp.xcodeproj/project.pbxproj @@ -62,6 +62,7 @@ 2C1061AC285C3C4300EBD614 /* StepQuizChoiceViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C1061AB285C3C4300EBD614 /* StepQuizChoiceViewModel.swift */; }; 2C106D9928C1CE6E004FA584 /* SendEmailFeedbackController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C106D9828C1CE6E004FA584 /* SendEmailFeedbackController.swift */; }; 2C11D5CA2A11311900C59238 /* FeedbackGeneratorPreviewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C11D5C92A11311900C59238 /* FeedbackGeneratorPreviewView.swift */; }; + 2C15720A2AB98F9400DD02D3 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2C1572092AB98F9400DD02D3 /* Info.plist */; }; 2C177EC32837B65500D841DB /* View+Frame.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C177EC22837B65500D841DB /* View+Frame.swift */; }; 2C1860FC2923C540007D4EBF /* AppFeatureStateKsExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C1860FB2923C540007D4EBF /* AppFeatureStateKsExtensions.swift */; }; 2C1F5869280D063800372A37 /* WebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C1F5868280D063800372A37 /* WebViewController.swift */; }; @@ -633,6 +634,7 @@ 2C1061AB285C3C4300EBD614 /* StepQuizChoiceViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepQuizChoiceViewModel.swift; sourceTree = ""; }; 2C106D9828C1CE6E004FA584 /* SendEmailFeedbackController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendEmailFeedbackController.swift; sourceTree = ""; }; 2C11D5C92A11311900C59238 /* FeedbackGeneratorPreviewView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedbackGeneratorPreviewView.swift; sourceTree = ""; }; + 2C1572092AB98F9400DD02D3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 2C177EC22837B65500D841DB /* View+Frame.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+Frame.swift"; sourceTree = ""; }; 2C1860FB2923C540007D4EBF /* AppFeatureStateKsExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppFeatureStateKsExtensions.swift; sourceTree = ""; }; 2C1F5868280D063800372A37 /* WebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebViewController.swift; sourceTree = ""; }; @@ -2201,6 +2203,7 @@ 2C919DEE27EEF5BC0022A2F2 /* iosHyperskillAppTests */ = { isa = PBXGroup; children = ( + 2C1572092AB98F9400DD02D3 /* Info.plist */, 2C1F587F280D305C00372A37 /* CollectionsTests */, 2C1F587C280D2F6600372A37 /* ExtensionsTests */, 2CE7B48C2AB0A06000DCBE4D /* FrameworksTests */, @@ -3603,6 +3606,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 2C15720A2AB98F9400DD02D3 /* Info.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4272,18 +4276,18 @@ BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 187; + CURRENT_PROJECT_VERSION = 191; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = 3DWS674B2M; - GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = iosHyperskillAppTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.0; - MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = org.hyperskill.AppTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iosHyperskillApp.app/iosHyperskillApp"; + VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; }; @@ -4293,17 +4297,17 @@ BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 187; + CURRENT_PROJECT_VERSION = 191; DEVELOPMENT_TEAM = 3DWS674B2M; - GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = iosHyperskillAppTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.0; - MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = org.hyperskill.AppTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iosHyperskillApp.app/iosHyperskillApp"; + VERSIONING_SYSTEM = "apple-generic"; }; name = Release; }; @@ -4314,20 +4318,16 @@ CODE_SIGN_ENTITLEMENTS = NotificationServiceExtension/NotificationServiceExtension.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 187; + CURRENT_PROJECT_VERSION = 191; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = 3DWS674B2M; - GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = NotificationServiceExtension/Info.plist; - INFOPLIST_KEY_CFBundleDisplayName = NotificationServiceExtension; - INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 Stepik Technologies s.r.o. All rights reserved."; IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.32; PRODUCT_BUNDLE_IDENTIFIER = org.hyperskill.App.NotificationServiceExtension; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -4335,6 +4335,7 @@ SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; }; @@ -4345,19 +4346,15 @@ CODE_SIGN_ENTITLEMENTS = NotificationServiceExtension/NotificationServiceExtension.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 187; + CURRENT_PROJECT_VERSION = 191; DEVELOPMENT_TEAM = 3DWS674B2M; - GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = NotificationServiceExtension/Info.plist; - INFOPLIST_KEY_CFBundleDisplayName = NotificationServiceExtension; - INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 Stepik Technologies s.r.o. All rights reserved."; IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.32; PRODUCT_BUNDLE_IDENTIFIER = org.hyperskill.App.NotificationServiceExtension; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -4365,6 +4362,7 @@ SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; }; name = Release; }; @@ -4493,6 +4491,7 @@ CODE_SIGN_ENTITLEMENTS = iosHyperskillApp/iosHyperskillApp.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 191; DEVELOPMENT_ASSET_PATHS = "\"iosHyperskillApp/Preview Content\""; DEVELOPMENT_TEAM = 3DWS674B2M; ENABLE_PREVIEWS = YES; @@ -4515,6 +4514,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; }; @@ -4527,6 +4527,7 @@ CODE_SIGN_ENTITLEMENTS = iosHyperskillApp/iosHyperskillApp.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 191; DEVELOPMENT_ASSET_PATHS = "\"iosHyperskillApp/Preview Content\""; DEVELOPMENT_TEAM = 3DWS674B2M; ENABLE_PREVIEWS = YES; @@ -4549,6 +4550,7 @@ SWIFT_OBJC_BRIDGING_HEADER = "iosHyperskillApp/iosHyperskillApp-Bridging-Header.h"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; }; name = Release; }; diff --git a/iosHyperskillApp/iosHyperskillApp/Info.plist b/iosHyperskillApp/iosHyperskillApp/Info.plist index 5bac85ad20..b13021e464 100644 --- a/iosHyperskillApp/iosHyperskillApp/Info.plist +++ b/iosHyperskillApp/iosHyperskillApp/Info.plist @@ -21,7 +21,7 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.33 + 1.34 CFBundleURLTypes @@ -34,7 +34,7 @@ CFBundleVersion - 187 + 191 FirebaseAppDelegateProxyEnabled FirebaseMessagingAutoInitEnabled diff --git a/iosHyperskillApp/iosHyperskillApp/Sources/Frameworks/Notifications/NotificationsService.swift b/iosHyperskillApp/iosHyperskillApp/Sources/Frameworks/Notifications/NotificationsService.swift index eaa648c908..0e8ef2a6bc 100644 --- a/iosHyperskillApp/iosHyperskillApp/Sources/Frameworks/Notifications/NotificationsService.swift +++ b/iosHyperskillApp/iosHyperskillApp/Sources/Frameworks/Notifications/NotificationsService.swift @@ -139,6 +139,7 @@ extension NotificationsService { case pushNotificationData case image case fcmOptions = "fcm_options" + case notificationID = "notification_id" } } @@ -177,6 +178,9 @@ extension NotificationsService { } // Set necessary keys to aps dict (see shared PushNotificationData.kt) + if let notificationID = userInfo[PayloadKey.notificationID.rawValue] { + apsDict[PayloadKey.notificationID.rawValue] = notificationID + } if let badgeID = userInfo[PayloadKey.badge.rawValue] { apsDict[PayloadKey.badge.rawValue] = badgeID } diff --git a/iosHyperskillApp/iosHyperskillAppTests/Info.plist b/iosHyperskillApp/iosHyperskillAppTests/Info.plist new file mode 100644 index 0000000000..f45e4c4b8a --- /dev/null +++ b/iosHyperskillApp/iosHyperskillAppTests/Info.plist @@ -0,0 +1,12 @@ + + + + + CFBundleName + $(PRODUCT_NAME) + CFBundleVersion + 191 + CFBundleShortVersionString + 1.34 + + diff --git a/shared/src/commonMain/kotlin/org/hyperskill/app/notification/remote/domain/analytic/PushNotificationClickedHyperskillAnalyticEvent.kt b/shared/src/commonMain/kotlin/org/hyperskill/app/notification/remote/domain/analytic/PushNotificationClickedHyperskillAnalyticEvent.kt index 58cec55713..4d5377b494 100644 --- a/shared/src/commonMain/kotlin/org/hyperskill/app/notification/remote/domain/analytic/PushNotificationClickedHyperskillAnalyticEvent.kt +++ b/shared/src/commonMain/kotlin/org/hyperskill/app/notification/remote/domain/analytic/PushNotificationClickedHyperskillAnalyticEvent.kt @@ -20,7 +20,9 @@ import org.hyperskill.app.notification.remote.domain.model.PushNotificationData * "context": * { * "type": "STREAK_THREE" || "SELECT_FIRST_TRACK" || ..., - * "group": "Routine learning" || "Re-engagement" || ... + * "category": "Routine learning" || "Re-engagement" || ..., + * "image": "https://hyperskill.org/image.png", + * "notification_id": "12345" * } * } * ``` @@ -36,10 +38,6 @@ class PushNotificationClickedHyperskillAnalyticEvent( ) { override val params: Map get() = super.params + mapOf( - PARAM_CONTEXT to mapOf( - PushNotificationHyperskillAnalyticParams.PARAM_TYPE to pushNotificationData.typeString, - PushNotificationHyperskillAnalyticParams.PARAM_CATEGORY to pushNotificationData.categoryString, - PushNotificationHyperskillAnalyticParams.PARAM_IMAGE to pushNotificationData.image - ) + PARAM_CONTEXT to PushNotificationDataAnalyticContextMapper.map(pushNotificationData) ) } \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/org/hyperskill/app/notification/remote/domain/analytic/PushNotificationDataAnalyticContextMapper.kt b/shared/src/commonMain/kotlin/org/hyperskill/app/notification/remote/domain/analytic/PushNotificationDataAnalyticContextMapper.kt new file mode 100644 index 0000000000..c89d40fc2b --- /dev/null +++ b/shared/src/commonMain/kotlin/org/hyperskill/app/notification/remote/domain/analytic/PushNotificationDataAnalyticContextMapper.kt @@ -0,0 +1,14 @@ +package org.hyperskill.app.notification.remote.domain.analytic + +import org.hyperskill.app.notification.remote.domain.model.PushNotificationData +import ru.nobird.app.core.model.mapOfNotNull + +internal object PushNotificationDataAnalyticContextMapper { + fun map(pushNotificationData: PushNotificationData): Map = + mapOfNotNull( + PushNotificationHyperskillAnalyticParams.PARAM_TYPE to pushNotificationData.typeString, + PushNotificationHyperskillAnalyticParams.PARAM_CATEGORY to pushNotificationData.categoryString, + PushNotificationHyperskillAnalyticParams.PARAM_IMAGE to pushNotificationData.image, + PushNotificationHyperskillAnalyticParams.PARAM_NOTIFICATION_ID to pushNotificationData.notificationId + ) +} \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/org/hyperskill/app/notification/remote/domain/analytic/PushNotificationHyperskillAnalyticParams.kt b/shared/src/commonMain/kotlin/org/hyperskill/app/notification/remote/domain/analytic/PushNotificationHyperskillAnalyticParams.kt index 04009a21da..21941da7c9 100644 --- a/shared/src/commonMain/kotlin/org/hyperskill/app/notification/remote/domain/analytic/PushNotificationHyperskillAnalyticParams.kt +++ b/shared/src/commonMain/kotlin/org/hyperskill/app/notification/remote/domain/analytic/PushNotificationHyperskillAnalyticParams.kt @@ -4,4 +4,5 @@ internal object PushNotificationHyperskillAnalyticParams { const val PARAM_TYPE = "type" const val PARAM_CATEGORY = "category" const val PARAM_IMAGE = "image" + const val PARAM_NOTIFICATION_ID = "notification_id" } \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/org/hyperskill/app/notification/remote/domain/analytic/PushNotificationShownHyperskillAnalyticEvent.kt b/shared/src/commonMain/kotlin/org/hyperskill/app/notification/remote/domain/analytic/PushNotificationShownHyperskillAnalyticEvent.kt index 9f1111249c..f5b248f3d3 100644 --- a/shared/src/commonMain/kotlin/org/hyperskill/app/notification/remote/domain/analytic/PushNotificationShownHyperskillAnalyticEvent.kt +++ b/shared/src/commonMain/kotlin/org/hyperskill/app/notification/remote/domain/analytic/PushNotificationShownHyperskillAnalyticEvent.kt @@ -20,7 +20,9 @@ import org.hyperskill.app.notification.remote.domain.model.PushNotificationData * "context": * { * "type": "STREAK_THREE" || "SELECT_FIRST_TRACK" || ..., - * "group": "Routine learning" || "Re-engagement" || ... + * "category": "Routine learning" || "Re-engagement" || ..., + * "image": "https://hyperskill.org/image.png", + * "notification_id": "12345" * } * } * ``` @@ -36,9 +38,6 @@ class PushNotificationShownHyperskillAnalyticEvent( ) { override val params: Map get() = super.params + mapOf( - PARAM_CONTEXT to mapOf( - PushNotificationHyperskillAnalyticParams.PARAM_TYPE to pushNotificationData.typeString, - PushNotificationHyperskillAnalyticParams.PARAM_CATEGORY to pushNotificationData.categoryString - ) + PARAM_CONTEXT to PushNotificationDataAnalyticContextMapper.map(pushNotificationData) ) } \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/org/hyperskill/app/notification/remote/domain/model/PushNotificationData.kt b/shared/src/commonMain/kotlin/org/hyperskill/app/notification/remote/domain/model/PushNotificationData.kt index 857c508563..0cd041261e 100644 --- a/shared/src/commonMain/kotlin/org/hyperskill/app/notification/remote/domain/model/PushNotificationData.kt +++ b/shared/src/commonMain/kotlin/org/hyperskill/app/notification/remote/domain/model/PushNotificationData.kt @@ -5,6 +5,8 @@ import kotlinx.serialization.Serializable @Serializable data class PushNotificationData( + @SerialName("notification_id") + val notificationId: String? = null, @SerialName("category") val typeString: String, @SerialName("thread-id") diff --git a/shared/src/commonTest/kotlin/org/hyperskill/main/AppFeatureTest.kt b/shared/src/commonTest/kotlin/org/hyperskill/main/AppFeatureTest.kt index 82377b1423..0f73dc97ab 100644 --- a/shared/src/commonTest/kotlin/org/hyperskill/main/AppFeatureTest.kt +++ b/shared/src/commonTest/kotlin/org/hyperskill/main/AppFeatureTest.kt @@ -54,8 +54,8 @@ class AppFeatureTest { AppFeature.Message.UserAccountStatus( Profile.stub(isGuest = true, trackId = 1), PushNotificationData( - PushNotificationType.STREAK_NEW.name, - PushNotificationCategory.CONTINUE_LEARNING.backendName!! + typeString = PushNotificationType.STREAK_NEW.name, + categoryString = PushNotificationCategory.CONTINUE_LEARNING.backendName!! ) ) ) diff --git a/shared/src/commonTest/kotlin/org/hyperskill/notification/NotificationClickHandlingFeatureTest.kt b/shared/src/commonTest/kotlin/org/hyperskill/notification/NotificationClickHandlingFeatureTest.kt index b32766221c..2bb7dbd136 100644 --- a/shared/src/commonTest/kotlin/org/hyperskill/notification/NotificationClickHandlingFeatureTest.kt +++ b/shared/src/commonTest/kotlin/org/hyperskill/notification/NotificationClickHandlingFeatureTest.kt @@ -18,8 +18,8 @@ class NotificationClickHandlingFeatureTest { NotificationClickHandlingFeature.State, NotificationClickHandlingFeature.Message.NotificationClicked( PushNotificationData( - PushNotificationType.STREAK_NEW.name, - PushNotificationCategory.CONTINUE_LEARNING.backendName!! + typeString = PushNotificationType.STREAK_NEW.name, + categoryString = PushNotificationCategory.CONTINUE_LEARNING.backendName!! ), isUserAuthorized = false, notificationLaunchedApp = true @@ -38,8 +38,8 @@ class NotificationClickHandlingFeatureTest { NotificationClickHandlingFeature.State, NotificationClickHandlingFeature.Message.NotificationClicked( PushNotificationData( - PushNotificationType.STREAK_NEW.name, - PushNotificationCategory.CONTINUE_LEARNING.backendName!! + typeString = PushNotificationType.STREAK_NEW.name, + categoryString = PushNotificationCategory.CONTINUE_LEARNING.backendName!! ), isUserAuthorized = true, notificationLaunchedApp = true