Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
066955c
chore: remove package resolved file
eligutovsky Nov 16, 2023
b5c37af
build: disable carthage
eligutovsky Nov 16, 2023
f821a62
build: version 5.5.0
eligutovsky Nov 16, 2023
00c1608
chore: remove carthage badge
eligutovsky Nov 16, 2023
fc0bb50
chore: point ci badge to master branch
eligutovsky Nov 16, 2023
81d5919
chore: return carthage badge
eligutovsky Nov 19, 2023
aa6287e
ci: fix the unit tests runner (#80)
eligutovsky Nov 20, 2023
925c2aa
fix: typo
eligutovsky Nov 20, 2023
9e83cd5
feat(API): add track Open Notification metric API (#78)
eligutovsky Nov 20, 2023
dd49411
chore: update homebrew check
eligutovsky Nov 20, 2023
3e6aa6c
chore: bootstrap
eligutovsky Nov 20, 2023
efae80b
fix: add missing fileref
eligutovsky Nov 20, 2023
e5789dc
Merge branch 'master' into rc/5.6.0
eligutovsky Nov 23, 2023
60b4bdb
fix: do not generate user_agent from webkit
eligutovsky Nov 24, 2023
47f0cbe
build: version 5.7.0
eligutovsky Dec 8, 2023
78c4929
refactor: badge arithmetic
eligutovsky Dec 8, 2023
19b9b9b
Merge branch 'rc/5.7.0' into fix/flaky-test
eligutovsky Dec 8, 2023
4cdcefa
chore: delete user agent event
eligutovsky Dec 31, 2023
21cdd59
tests: fix tests
eligutovsky Jan 2, 2024
f6fd4c0
chore: auto updated scheme
eligutovsky Jan 2, 2024
8eaf717
chore: migration version 6.0.0
eligutovsky Feb 6, 2024
6d2fe1e
chore: add debug product
eligutovsky Feb 6, 2024
a64a40a
feat: expose sdk state
eligutovsky Feb 6, 2024
1f677e8
fix: return back access level of OptimoveInApp
eligutovsky Feb 6, 2024
c8fb299
refactor: rename method
eligutovsky Feb 6, 2024
332bb01
docs: update changelog
eligutovsky Feb 6, 2024
1f2427d
chore: move back access level of in-app
eligutovsky Feb 7, 2024
6efe532
chore: add in-app into optimove class
eligutovsky Feb 7, 2024
4323989
fix: switch in-app manager to optimove storage
eligutovsky Feb 7, 2024
0bd132a
Added a privacy manifest
k-antipochkin Mar 14, 2024
bf012dc
Added a self prefix in a closure to allow compilation on pre 5.8 swif…
k-antipochkin Mar 14, 2024
9b9f528
Updated version to 5.7.0, changelog
k-antipochkin Mar 14, 2024
8ae6a76
Added the privacy to podspec resource_bundles
k-antipochkin Mar 21, 2024
a6278a4
add identifiable
eligutovsky Mar 26, 2024
e36001e
Remove web to app banner (#102)
k-antipochkin Apr 1, 2024
e28fd2b
Merge pull request #107 from optimove-tech/feat/privacy-manifest-2
k-antipochkin Apr 2, 2024
f733e4c
Fixed the deeplink decoding, exposed a new urlOpened API
k-antipochkin Apr 5, 2024
c9d8b65
Updated version to 5.8.0
k-antipochkin Apr 5, 2024
fb4f029
fixed the immediate initialization
k-antipochkin Apr 10, 2024
9ac681b
Updated changelog
k-antipochkin Apr 10, 2024
716ed38
Undo setting credentials before initializing Optimobile
k-antipochkin Apr 10, 2024
84384fd
Initializing Optimobile before setting credentials
k-antipochkin Apr 10, 2024
5c08ce9
Merge pull request #108 from optimove-tech/fix/215415-dl
k-antipochkin Apr 17, 2024
fcb452a
Merge branch 'master' into fix/flaky-test
k-antipochkin May 8, 2024
81a2d28
Changed the migration version to be 5_9_0
k-antipochkin May 8, 2024
750d9d2
Updated version to 5.9.0
k-antipochkin May 8, 2024
1fbede9
Merge pull request #86 from optimove-tech/fix/flaky-test
k-antipochkin May 16, 2024
6e9d521
BA#218543 Add preference center functionality (#111)
daniela-opti Sep 3, 2024
f63a1b3
Merge commit 'e28fd2b7506d5e00b36fdf6fd5e6e70904b9e3fc' into refactor…
k-antipochkin Sep 5, 2024
82a5b41
Merge commit '5c08ce95a08a2308c61b231dd8e021f123c48cd4' into refactor…
k-antipochkin Sep 5, 2024
907cbe0
Merge commit '1fbede97d754d611d50a6c25e0a299bc94593d93' into refactor…
k-antipochkin Sep 6, 2024
92cd25b
Merge branch 'master' into refactor/notification-service-extension-2
k-antipochkin Sep 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Changelog

## 6.0.0

- Add Preference Center feature. The new functionality is available through the following methods:
- `OptimovePreferenceCenter.getInstance().setCustomerPreferencesAsync()`
- `OptimovePreferenceCenter.getInstance().getPreferencesAsync()`

Breaking changes:
- iOS 13 required for using Preference Center
- removed `OptimoveConfigBuilder.setCredentials` unintentionally public method

## 5.9.0

- Remove `SetUserAgent` event

## 5.8.0

- Add a new public API `Optimove.shared.urlOpened(url: url)` to allow easily forwarding urls to Optimove instead of relying on AppDeletegate's `application(_:continue:restorationHandler:)`
- Fix deeplink decoding issue
- Fix immediate initialization of the SDK

## 5.7.0

- Add Privacy Manifest
- Fix explicit `self` for `weak self` captures to allow pre 5.8 Swift compilation
- Remove web to app banner code

## 5.6.0

- Support the delayed configuration for SDK. Add new public APIs:
Expand Down
2 changes: 2 additions & 0 deletions Optimove.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
objects = {

/* Begin PBXFileReference section */
58371F3A2BA358CB00791552 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
FE31495485A751448C7DF822 /* SDK */ = {isa = PBXFileReference; lastKnownFileType = folder; name = SDK; path = .; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */

/* Begin PBXGroup section */
0FF4DF40AC6AAC3B8661208C = {
isa = PBXGroup;
children = (
58371F3A2BA358CB00791552 /* PrivacyInfo.xcprivacy */,
9BB5B51B953402330D6DC400 /* Packages */,
);
sourceTree = "<group>";
Expand Down
11 changes: 1 addition & 10 deletions Optimove.xcodeproj/xcshareddata/xcschemes/UnitTests.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7013308FB86B06E91BDD05C2"
BuildableName = "libOptimoveCore.a"
BlueprintName = "OptimoveCore"
ReferencedContainer = "container:Optimove.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand Down Expand Up @@ -67,7 +58,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7013308FB86B06E91BDD05C2"
BuildableName = "libOptimoveCore.a"
BuildableName = "OptimoveCore.framework"
BlueprintName = "OptimoveCore"
ReferencedContainer = "container:Optimove.xcodeproj">
</BuildableReference>
Expand Down
2 changes: 1 addition & 1 deletion OptimoveCore.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'OptimoveCore'
s.version = '5.6.0'
s.version = '6.0.0'
s.summary = 'Official Optimove SDK for iOS. Core framework.'
s.description = 'The core framework is used to share code-base between other Optimove frameworks.'
s.homepage = 'https://github.com/optimove-tech/Optimove-SDK-iOS'
Expand Down
2 changes: 1 addition & 1 deletion OptimoveCore/Sources/Classes/Constants/SDKVersion.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Copyright © 2019 Optimove. All rights reserved.

public let SDKVersion = "5.6.0"
public let SDKVersion = "6.0.0"
31 changes: 7 additions & 24 deletions OptimoveCore/Sources/Classes/OptimobileHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,31 +42,14 @@ public struct OptimobileHelper {
return installId()
}

// FIXME: Use PushNotifcation
public func getBadgeFromUserInfo(userInfo: [AnyHashable: Any]) -> NSNumber? {
let custom = userInfo["custom"] as? [AnyHashable: Any]
let aps = userInfo["aps"] as? [AnyHashable: Any]

if custom == nil || aps == nil {
return nil
}

let incrementBy: NSNumber? = custom!["badge_inc"] as? NSNumber
let badge: NSNumber? = aps!["badge"] as? NSNumber

if badge == nil {
return nil
}

var newBadge: NSNumber? = badge
if let incrementBy = incrementBy, let currentVal: NSNumber = storage[.badgeCount] {
newBadge = NSNumber(value: currentVal.intValue + incrementBy.intValue)

if newBadge!.intValue < 0 {
newBadge = 0
}
public func getBadge(notification: PushNotification) -> Int? {
if let incrementBy = notification.badgeIncrement,
let current: Int = storage[.badgeCount]
{
let badge = current + incrementBy
return badge < 0 ? 0 : badge
}

return newBadge
return notification.aps.badge
}
}
6 changes: 3 additions & 3 deletions OptimoveCore/Sources/Classes/PushNotification.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public struct PushNotification: Decodable {
public let aps: Aps
public let attachment: PushNotification.Attachment?
/// Optimove badge
public let badge: Int?
public let badgeIncrement: Int?
public let buttons: [PushNotification.Button]?
public let deeplink: PushNotification.Data?
public let message: PushNotification.Data
Expand All @@ -86,7 +86,7 @@ public struct PushNotification: Decodable {
case a
case aps
case attachments
case badge = "badge_inc"
case badgeIncrement = "badge_inc"
case buttons = "k.buttons"
case custom
case deeplink = "k.deepLink"
Expand All @@ -106,7 +106,7 @@ public struct PushNotification: Decodable {
self.attachment = try container.decodeIfPresent(Attachment.self, forKey: .attachments)

let custom = try container.nestedContainer(keyedBy: CodingKeys.self, forKey: .custom)
self.badge = try custom.decodeIfPresent(Int.self, forKey: .badge)
self.badgeIncrement = try custom.decodeIfPresent(Int.self, forKey: .badgeIncrement)
self.url = try custom.decodeIfPresent(URL.self, forKey: .u)

let a = try custom.nestedContainer(keyedBy: CodingKeys.self, forKey: .a)
Expand Down
3 changes: 0 additions & 3 deletions OptimoveCore/Sources/Classes/Storage/KeyValueStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public enum StorageKey: String, CaseIterable {
case tenantToken
case visitorID
case version
case userAgent
case deviceResolutionWidth
case deviceResolutionHeight
case advertisingIdentifier
Expand Down Expand Up @@ -58,7 +57,6 @@ public protocol StorageValue {
var tenantToken: String? { get set }
var visitorID: String? { get set }
var version: String? { get set }
var userAgent: String? { get set }
var deviceResolutionWidth: Float? { get set }
var deviceResolutionHeight: Float? { get set }
var advertisingIdentifier: String? { get set }
Expand All @@ -77,7 +75,6 @@ public protocol StorageValue {
func getTenantToken() throws -> String
func getVisitorID() throws -> String
func getVersion() throws -> String
func getUserAgent() throws -> String
func getDeviceResolutionWidth() throws -> Float
func getDeviceResolutionHeight() throws -> Float
/// Called when a migration is finished for the version.
Expand Down
2 changes: 1 addition & 1 deletion OptimoveCore/Tests/Sources/PushNotificationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class PushNotificationTests: XCTestCase, FileAccessible {
fileName = "notification-badge.json"
let decoder = JSONDecoder()
let notification = try decoder.decode(PushNotification.self, from: data)
XCTAssertEqual(notification.badge, 42)
XCTAssertEqual(notification.badgeIncrement, 42)
}

func test_decode_buttons() throws {
Expand Down
5 changes: 4 additions & 1 deletion OptimoveNotificationServiceExtension.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'OptimoveNotificationServiceExtension'
s.version = '5.6.0'
s.version = '6.0.0'
s.summary = 'Official Optimove SDK for iOS. Notification service extension framework.'
s.description = 'The notification service extension is used for handling additional content in push notifications.'
s.homepage = 'https://github.com/optimove-tech/Optimove-SDK-iOS'
Expand All @@ -12,5 +12,8 @@ Pod::Spec.new do |s|
s.swift_version = '5'
base_dir = "OptimoveNotificationServiceExtension/"
s.source_files = base_dir + 'Sources/**/*', 'OptimobileShared/**/*'
s.resource_bundles = {
'OptimoveNotificationServiceExtension' => ['OptimoveNotificationServiceExtension/PrivacyInfo.xcprivacy']
}
s.frameworks = 'Foundation', 'UserNotifications', 'UIKit'
end
23 changes: 23 additions & 0 deletions OptimoveNotificationServiceExtension/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>1C8F.1</string>
</array>
</dict>
</array>
<key>NSPrivacyTracking</key>
<false/>
<key>NSPrivacyTrackingDomains</key>
<array/>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public enum OptimoveNotificationService {
let data = try JSONSerialization.data(withJSONObject: userInfo)
let notification = try JSONDecoder().decode(PushNotification.self, from: data)
if bestAttemptContent.categoryIdentifier.isEmpty {
bestAttemptContent.categoryIdentifier = await buildCategory(notification: notification)
bestAttemptContent.categoryIdentifier = await registerCategory(notification: notification)
}
if let storage = try? UserDefaults.optimoveAppGroup() {
let mediaHelper = MediaHelper(storage: storage)
Expand All @@ -48,9 +48,9 @@ public enum OptimoveNotificationService {
bestAttemptContent.attachments = [attachment]
}
let optimobileHelper = OptimobileHelper(storage: storage)
if let badge = maybeSetBadge(userInfo: userInfo, optimobileHelper: optimobileHelper) {
if let badge = optimobileHelper.getBadge(notification: notification) {
storage.set(value: badge, key: .badgeCount)
bestAttemptContent.badge = badge
bestAttemptContent.badge = NSNumber(integerLiteral: badge)
}
let pendingNoticationHelper = PendingNotificationHelper(storage: storage)
pendingNoticationHelper.add(
Expand Down Expand Up @@ -94,7 +94,7 @@ public enum OptimoveNotificationService {
}
}

static func buildCategory(notification: PushNotification) async -> String {
static func registerCategory(notification: PushNotification) async -> String {
let categoryIdentifier = CategoryManager.getCategoryId(messageId: notification.message.id)
let category = UNNotificationCategory(
identifier: categoryIdentifier,
Expand Down Expand Up @@ -130,20 +130,4 @@ public enum OptimoveNotificationService {
url: tempURL
)
}

static func maybeSetBadge(
userInfo: [AnyHashable: Any],
optimobileHelper: OptimobileHelper
) -> NSNumber? {
let aps = userInfo["aps"] as! [AnyHashable: Any]
if let contentAvailable = aps["content-available"] as? Int, contentAvailable == 1 {
return nil
}

let newBadge: NSNumber? = optimobileHelper.getBadgeFromUserInfo(userInfo: userInfo)
if newBadge == nil {
return nil
}
return newBadge
}
}
5 changes: 4 additions & 1 deletion OptimoveSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'OptimoveSDK'
s.version = '5.6.0'
s.version = '6.0.0'
s.summary = 'Official Optimove SDK for iOS.'
s.description = 'The Optimove SDK framework is used for reporting events and receive push notifications.'
s.homepage = 'https://github.com/optimove-tech/Optimove-SDK-iOS'
Expand All @@ -14,6 +14,9 @@ Pod::Spec.new do |s|
s.swift_version = '5'
base_dir = "OptimoveSDK/"
s.source_files = base_dir + 'Sources/Classes/**/*', 'OptimobileShared/**/*'
s.resource_bundles = {
'OptimoveSDK' => ['OptimoveSDK/PrivacyInfo.xcprivacy']
}
s.dependency 'OptimoveCore', s.version.to_s
s.frameworks = 'Foundation', 'UIKit', 'SystemConfiguration', 'UserNotifications', 'CoreData'
end
50 changes: 50 additions & 0 deletions OptimoveSDK/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyCollectedDataTypes</key>
<array>
<dict>
<key>NSPrivacyCollectedDataType</key>
<string>NSPrivacyCollectedDataTypeProductInteraction</string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<true/>
<key>NSPrivacyCollectedDataTypeTracking</key>
<false/>
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string>NSPrivacyCollectedDataTypePurposeAnalytics</string>
<string>NSPrivacyCollectedDataTypePurposeProductPersonalization</string>
</array>
</dict>
<dict>
<key>NSPrivacyCollectedDataType</key>
<string>NSPrivacyCollectedDataTypeUserID</string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<true/>
<key>NSPrivacyCollectedDataTypeTracking</key>
<false/>
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string>NSPrivacyCollectedDataTypePurposeAnalytics</string>
<string>NSPrivacyCollectedDataTypePurposeProductPersonalization</string>
</array>
</dict>
</array>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>1C8F.1</string>
</array>
</dict>
</array>
<key>NSPrivacyTracking</key>
<false/>
<key>NSPrivacyTrackingDomains</key>
<array/>
</dict>
</plist>
1 change: 0 additions & 1 deletion OptimoveSDK/Sources/Classes/Constants/OptimoveKeys.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ enum OptimoveKeys {
case userId = "user_id"
case realtimeUserId = "userId"
case realtimeupdatedVisitorId = "updatedVisitorId"
case setUserAgent = "user_agent_header_event"
case email
}
}
3 changes: 2 additions & 1 deletion OptimoveSDK/Sources/Classes/DI/Assembly.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ final class Assembly {
private func migrate() {
let migrations: [MigrationWork] = [
MigrationWork_3_3_0(),
MigrationWork_5_7_0(),
MigrationWork_6_0_0(),
MigrationWork_5_9_0()
]
migrations
.filter { $0.isAllowToMiragte(SDKVersion) }
Expand Down
22 changes: 0 additions & 22 deletions OptimoveSDK/Sources/Classes/Events/CoreEvents/SetUserAgent.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ extension Bundle {
var appVersion: String {
return Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "undefined"
}

var buildVersion: String {
return Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "undefined"
}
}
Loading