Skip to content

refactor: badge arithmetic [5]#93

Open
eligutovsky wants to merge 52 commits intofeat/key-value-storage-migrationfrom
refactor/notification-service-extension-2
Open

refactor: badge arithmetic [5]#93
eligutovsky wants to merge 52 commits intofeat/key-value-storage-migrationfrom
refactor/notification-service-extension-2

Conversation

@eligutovsky
Copy link
Member

@eligutovsky eligutovsky commented Dec 8, 2023

User description

Description of Changes

Final step of refactoring Notification Service Extension.

Breaking Changes

  • None

Release Checklist

Prepare:

  • Detail any breaking changes. Breaking changes require a new major version number
  • Check pod lib lint passes
  • Update any relevant sections of the repository wiki pages on a branch

Bump versions in:

  • OptimoveCore.podspec

  • OptimoveNotificationServiceExtension.podspec

  • OptimoveSDK.podspec

  • OptimoveCore/Sources/Classes/Constants/SDKVersion.swift

  • README.md

  • CHANGELOG.md

  • Update major version numbers in wiki (basic integration + push guides)

Integration tests

T&T Only

  • Init SDK with only T&T credentials
  • Associate customer
  • Associate email
  • Track events

Mobile Only

  • Init SDK with all credentials
  • Track events
  • Associate customer (verify both backends)
  • Register for push
  • Opt-in for In-App
  • Send test push
  • Send test In-App
  • Receive / trigger deep link handler (In-App/Push)
  • Receive / trigger the content extension, render image and action buttons for push
  • Verify push opened handler

Deferred Deep Links

  • With app installed, trigger deep link handler
  • With app uninstalled, follow deep link, install test bundle, verify deep link read from Clipboard, trigger deep link handler

Combined

  • Track event for T&T, verify push received
  • Trigger scheduled campaign, verify push received
  • Trigger scheduled campaign, verify In-App received

Release:

  • Squash and merge to master
  • Delete branch once merged
  • Create tag from master matching chosen version
  • Run pod trunk push to publish to CocoaPods

Post Release:

  • Push wiki pages to master

Generated description

Below is a concise technical summary of the changes proposed in this PR:
Introduces a new Preference Center feature for managing user communication preferences and refactors the SDK's internal mechanisms, including push notification badge calculation, removal of user agent tracking, and simplification of deep linking, while also updating SDK versioning and privacy manifests.

TopicDetails
SDK Refinements Enhances the SDK's core infrastructure by refactoring push notification badge calculation for clarity, removing the deprecated user agent tracking mechanism, simplifying deep linking handling by removing fingerprinting and adding a new public API, migrating In-App messaging data persistence to OptimoveStorage, and updating SDK versioning and privacy manifests.
Modified files (48)
  • OptimoveCore/Sources/Classes/OptimobileHelper.swift
  • OptimoveCore/Sources/Classes/OptimobileHelper.swift
  • OptimoveSDK/Sources/Classes/Migration/Version.swift
  • OptimoveSDK/Sources/Classes/Migration/Version.swift
  • OptimoveNotificationServiceExtension/Sources/OptimoveNotificationService.swift
  • OptimoveNotificationServiceExtension/Sources/OptimoveNotificationService.swift
  • OptimoveSDK/Sources/Classes/Optimobile/Optimobile+Push.swift
  • OptimoveSDK/Sources/Classes/Optimobile/Optimobile+Push.swift
  • OptimoveCore/Tests/Sources/PushNotificationTests.swift
  • OptimoveCore/Tests/Sources/PushNotificationTests.swift
  • OptimoveSDK/Sources/Classes/Migration/MigrationWork.swift
  • OptimoveSDK/Sources/Classes/Migration/MigrationWork.swift
  • OptimoveSDK/Sources/Classes/Optimobile/Optimobile+DeepLinking.swift
  • OptimoveSDK/Sources/Classes/Optimobile/Optimobile+DeepLinking.swift
  • Shared/Sources/OptimoveTestCase.swift
  • Shared/Sources/OptimoveTestCase.swift
  • OptimoveCore/Sources/Classes/PushNotification.swift
  • OptimoveCore/Sources/Classes/PushNotification.swift
  • OptimoveSDK/Sources/Classes/DI/Assembly.swift
  • OptimoveSDK/Sources/Classes/DI/Assembly.swift
  • OptimoveSDK/Sources/Classes/States/SdkState.swift
  • OptimoveSDK/Sources/Classes/States/SdkState.swift
  • OptimoveCore/Sources/Classes/Storage/KeyValueStorage.swift
  • OptimoveCore/Sources/Classes/Storage/KeyValueStorage.swift
  • OptimoveSDK/Sources/Classes/Optimobile/InApp/InAppManager.swift
  • OptimoveSDK/Sources/Classes/Optimobile/InApp/InAppManager.swift
  • OptimoveSDK/Sources/Classes/Extensions/Bundle+AppVersion.swift
  • OptimoveSDK/Sources/Classes/Extensions/Bundle+AppVersion.swift
  • OptimoveSDK/Sources/Classes/Optimobile/OptimoveInApp.swift
  • OptimoveSDK/Sources/Classes/Optimobile/OptimoveInApp.swift
  • OptimoveSDK/Sources/Classes/OnStartHelpers/UserAgentGenerator.swift
  • OptimoveSDK/Sources/Classes/Optimobile/DeepLinkFingerprinter.swift
  • OptimoveCore/Sources/Classes/Constants/SDKVersion.swift
  • OptimoveSDK.podspec
  • OptimoveCore.podspec
  • OptimoveSDK/Sources/Classes/Factories/CoreEventFactory.swift
  • OptimoveNotificationServiceExtension.podspec
  • OptimoveSDK/Sources/Classes/OnStartHelpers/OnStartEventGenerator.swift
  • OptimoveSDK/Sources/Classes/Events/CoreEvents/SetUserAgent.swift
  • OptimoveSDK/PrivacyInfo.xcprivacy
  • OptimoveNotificationServiceExtension/PrivacyInfo.xcprivacy
  • Optimove.xcodeproj/xcshareddata/xcschemes/UnitTests.xcscheme
  • Optimove.xcodeproj/project.pbxproj
  • OptimoveSDK/Tests/Sources/Generators/OnStartEventGeneratorTests.swift
  • OptimoveSDK/Tests/Sources/Events/CoreEvents/SetUserAgentEventTests.swift
  • OptimoveSDK/Tests/Sources/Events/CoreEventFactoryTests.swift
  • OptimoveSDK/Sources/Classes/Constants/OptimoveKeys.swift
  • CHANGELOG.md
Latest Contributors(2)
UserCommitDate
adamball1bump-version-numbers-f...July 24, 2025
konstantin_a@optimove.comEmbedded-related-fixesJune 11, 2025
Other Other files
Modified files (5)
  • OptimoveSDK/Sources/Classes/Optimobile/Optimobile.swift
  • OptimoveSDK/Sources/Classes/Optimobile/Optimobile.swift
  • OptimoveSDK/Sources/Classes/Storage/OptimoveStorage.swift
  • OptimoveSDK/Sources/Classes/Storage/OptimoveStorage.swift
  • OptimoveSDK/Sources/Classes/Services/ServiceLocator.swift
Latest Contributors(2)
UserCommitDate
daniela-optiBA-218543-Add-preferen...September 03, 2024
konstantin_a@optimove.comInitializing-Optimobil...April 10, 2024
Preference Center Adds a new public-facing feature allowing users to manage their communication preferences (topics and channels). This includes new data models, configuration options, and asynchronous APIs for fetching and updating user preferences, requiring iOS 13.
Modified files (11)
  • OptimoveSDK/Sources/Classes/NetworkClient/NetworkRequest.swift
  • OptimoveSDK/Sources/Classes/NetworkClient/NetworkRequest.swift
  • OptimoveSDK/Sources/Classes/OptimoveConfig.swift
  • OptimoveSDK/Sources/Classes/OptimoveConfig.swift
  • OptimoveSDK/Sources/Classes/Optimove.swift
  • OptimoveSDK/Sources/Classes/Optimove.swift
  • OptimoveSDK/Sources/Classes/PreferenceCenter/Models/PreferenceCenterConfig.swift
  • README.md
  • OptimoveSDK/Sources/Classes/PreferenceCenter/Models/OptimovePC.swift
  • OptimoveSDK/Sources/Classes/PreferenceCenter/OptimovePreferenceCenter.swift
  • CHANGELOG.md
Latest Contributors(2)
UserCommitDate
adamball1bump-version-numbers-f...July 24, 2025
konstantin_a@optimove.comEmbedded-related-fixesJune 11, 2025
This pull request is reviewed by Baz. Review like a pro on (Baz).

@eligutovsky eligutovsky marked this pull request as ready for review December 8, 2023 15:32
@eligutovsky eligutovsky mentioned this pull request Jan 29, 2024
34 tasks
eligutovsky and others added 24 commits February 7, 2024 17:22
* Removed web to app banner

* Updated changelog

---------

Co-authored-by: Konstantin Antipochkin <konstantin_a@optimove.com>
# Conflicts:
#	OptimoveCore.podspec
#	OptimoveCore/Sources/Classes/Constants/SDKVersion.swift
#	OptimoveNotificationServiceExtension.podspec
#	OptimoveSDK.podspec
* Add pref center functionality

* Update comment

* Separate models into their own files

* Initialise Preference Center as a separate instance

* Replace var with let in struct

* Remove getters

* Add return to switch statement

* Shuffle things around; expose Optimove.PreferenceCenter

* Call it OptimovePreferenceCenter

* Get closer to Android implementation

* Add get config values func

* Check customer + visitor id

* Remove objc classes

* Give preferenceCenterCredentials a default nil value, so it doesn't break existing apps

* Add method for enabling preference center

* Take care of delayed init

* Do not initialize preference center if optimove creds are missing

* Log errors

* Use region instead of environment for region

* Add coding keys, so we stay consistent with naming

* Get config from Optimove, instead of storing it in pref center class

* Take enum out of initializer, oops

* Get into reviewable state

* Use CustomStringConvertible protocol for enum

* Add pref center docs link

* Do not log error if preference center is not wanted (when building)

* Update preferenceUpdate model name

* Remove unused enum

* Add new errorNotConfigured result type

* Move channel into Preferences model

* Show error when setting credentials for a feature that was not requested

* Try to cover permutations of nullability

* Allow setCredentials to be called with nil, nil, prefCenterCreds

* Don't log error when delayed init and missing credentials

* Remove logger.debug

* Move public data structures under OptimovePC

* Remove public keyword in ctor for topics and preferences

* Address PR comments

* Make isPreferenceCenterConfigured only look at the features; don't care about credentials

* Bump versions

* Add extra check for config being nil

* Bring up to speed with Android

* Bring close to original

* Fix copy paste

* Add an extra if statement to cover nil optimoveCredentials for delayed init

* Clarify log

* Make preference center behave like the other features when feature is requested but no credentials were provided

* Make preference center behave like other features when it is not included in the feature set for delayed init, but credentials were provided

* Remove iOS 13.0 requirement

* Rename forgotten topics -> customerPreferences

* Catch the cases where optimove credentials are empty - do not initialize pref center

* Bring back Task and ios 13

* Remove client, only bring task

* Remove redundant ios 13 requirements

* Update major version to 6

* mention 2nd breaking change

---------

Co-authored-by: Vladislav Voicehovich <vladislav_v@optimove.com>
…/notification-service-extension-2

# Conflicts:
#	CHANGELOG.md
#	OptimoveSDK/Sources/Classes/Optimobile/Optimobile+DeepLinking.swift
…/notification-service-extension-2

# Conflicts:
#	OptimoveSDK/Sources/Classes/Optimobile/Optimobile.swift
…/notification-service-extension-2

# Conflicts:
#	OptimoveSDK/Sources/Classes/DI/Assembly.swift
#	OptimoveSDK/Sources/Classes/Migration/MigrationWork.swift
#	OptimoveSDK/Sources/Classes/Migration/Version.swift
#	OptimoveSDK/Sources/Classes/Storage/OptimoveStorage.swift
@pr-work-item-validator
Copy link

👋 Hey @eligutovsky,

❗️ Work Item link check failed: There is no Work Item linked to this PR.

🧩 Please add the Work Item ID to the PR title or description using the "Edit" option in the format below:
AB#XXXXX - replace X with a valid Work Item ID.

🟢 Once added, the validation will automatically run again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants