Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7dc01c5
Merge pull request #693 from mindbox-cloud/master
itmindbox Apr 6, 2026
2afc9d7
MOBILE-72: Refactor HTTP response handling to prioritize HTTP status …
Vailence Apr 6, 2026
484b45c
Bump addressable from 2.8.9 to 2.9.0 (#694)
dependabot[bot] Apr 8, 2026
747e703
MOBILE-108: Migrate Example app from CocoaPods to SPM
justSmK Apr 9, 2026
a88da71
MOBILE-108: Reorganize Example app from type-based to feature-based g…
justSmK Apr 9, 2026
e3933c4
MOBILE-0000: Bump fastlane to 2.233.0 to fix scan crash on Xcode 26.4…
justSmK Apr 28, 2026
4e74011
MOBILE-130: Route operations endpoints to configurable anonymizer URL
justSmK Apr 27, 2026
ff6951b
MOBILE-130: Test settings.baseAddresses parsing from mobile config
justSmK Apr 27, 2026
8fb075e
MOBILE-130: Centralize MBConfiguration tests and expand coverage
justSmK Apr 27, 2026
82c667b
MOBILE-130: Drop dead SDKLogsRoute and use the live path in tests
justSmK Apr 27, 2026
3723195
MOBILE-130: Accept domain inputs with optional scheme
justSmK Apr 27, 2026
d2a77e5
MOBILE-130: Rewrite URLValidator as a structural host validator
justSmK Apr 27, 2026
815c683
MOBILE-130: Tighten config-download fan-out and document softReset ex…
justSmK Apr 27, 2026
230ffcb
MOBILE-130: Clean up public docstring for MBConfiguration.operationsD…
justSmK Apr 27, 2026
288d791
MOBILE-130: Move operationsDomain next to domain in MBConfiguration init
justSmK Apr 27, 2026
7c83fd3
MOBILE-130: Store operationsDomain from JSON config in canonical sche…
justSmK Apr 28, 2026
030ed8f
MOBILE-130: Cover operationsDomain http/trailing-slash parity in init…
justSmK Apr 28, 2026
4abbd76
MOBILE-130: Address review feedback on operationsDomain decode and re…
justSmK Apr 28, 2026
ee494c1
MOBILE-130: Address review feedback on validator strictness and URL b…
justSmK Apr 29, 2026
573d0cf
MOBILE-130: Drop .prettyPrinted from trackVisit body serialization
justSmK Apr 29, 2026
bafc9f4
MOBILE-130: Use case-insensitive anchored range matching in HostNorma…
justSmK Apr 29, 2026
1612179
Merge pull request #701 from mindbox-cloud/mobile-130
justSmK Apr 29, 2026
14b73fc
MOBILE-120: Limit errorDetails to 1000 characters in InappShowFailure…
Vailence Apr 29, 2026
ce1957b
Merge pull request #704 from mindbox-cloud/feature/MOBILE-180
justSmK May 14, 2026
6e5bde5
MOBILE-164: Forward raw 2xx sync-operation body to WebView JS (#703)
Vailence May 14, 2026
519c333
Bump SDK version from 2.15.0 to 2.15.1
May 21, 2026
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
1 change: 0 additions & 1 deletion Example/.gitignore

This file was deleted.

474 changes: 139 additions & 335 deletions Example/Example.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions Example/Example.xcworkspace/contents.xcworkspacedata

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ final class AppDelegate: MindboxAppDelegate {
return true
}

// https://developers.mindbox.ru/docs/ios-send-push-notifications-appdelegate
// https://developers.mindbox.ru/docs/ios-quick-setup-push-notifications
func userNotificationCenter(
_ center: UNUserNotificationCenter,
willPresent notification: UNNotification,
Expand All @@ -49,7 +49,7 @@ final class AppDelegate: MindboxAppDelegate {
completionHandler([.list, .badge, .sound, .banner])
}

// https://developers.mindbox.ru/docs/ios-sdk-handle-tap
// https://developers.mindbox.ru/docs/ios-push-notification-deep-linking
override func userNotificationCenter(
_ center: UNUserNotificationCenter,
didReceive response: UNNotificationResponse,
Expand All @@ -66,7 +66,7 @@ final class AppDelegate: MindboxAppDelegate {
super.userNotificationCenter(center, didReceive: response, withCompletionHandler: completionHandler)
}

// https://developers.mindbox.ru/docs/ios-send-push-notifications-appdelegate
// https://developers.mindbox.ru/docs/ios-quick-setup-push-notifications
func registerForRemoteNotifications() {
UNUserNotificationCenter.current().delegate = self
DispatchQueue.main.async {
Expand Down
14 changes: 0 additions & 14 deletions Example/Example/Models/Payload.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@

import SwiftUI
import SwiftData
import Mindbox

struct NotificationCenterView: View {

var viewModel: NotificationCenterViewModelProtocol

@State private var showAlert = false
@State private var alertTitle = String()
@State private var alertMessage = String()

@Environment(\.modelContext) private var modelContext
@Query private var items: [Item]

var body: some View {
NavigationStack {
List {
Expand All @@ -31,7 +32,7 @@ struct NotificationCenterView: View {
Spacer()
}
}

.contentShape(Rectangle())
.onTapGesture {
viewModel.sendOperationNCPushOpen(notification: item.mbPushNotification)
Expand Down Expand Up @@ -60,7 +61,7 @@ struct NotificationCenterView: View {
Button("OK", action: {})
}
}

private func deleteItems(offsets: IndexSet) {
withAnimation {
let originalOffsets = IndexSet(offsets.map { items.count - 1 - $0 })
Expand All @@ -70,14 +71,47 @@ struct NotificationCenterView: View {
return
} else {
modelContext.delete(items[index])

}
}
}
UIImpactFeedbackGenerator(style: .heavy).impactOccurred()
}
}

// MARK: - NotificationCellView

private struct NotificationCellView: View {
var notification: PushNotification

var body: some View {
HStack(alignment: .center, content: {
if let imageUrl = notification.imageUrl, let url = URL(string: imageUrl) {
AsyncImage(url: url) { image in
image
.resizable()
.scaledToFill()
} placeholder: {
ProgressView()
}
.frame(maxWidth: 64, maxHeight: 64)
.clipShape(Circle())
}

VStack(alignment: .leading, content: {
Text(notification.title ?? "Empty")
.font(.headline)
Text(notification.body ?? "Empty")
.font(.subheadline)
.foregroundStyle(.gray)
Text(notification.clickUrl ?? "Empty")
.font(.footnote)
.foregroundStyle(.blue)
})
})
}
}

#Preview {
NotificationCenterView(viewModel: NotificationCenterViewModel())
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Item+SwiftData.swift
// NotificationModels.swift
// Example
//
// Created by Sergei Semko on 6/11/24.
Expand All @@ -13,7 +13,7 @@ import SwiftData
public final class Item {
public var timestamp: Date
public var mbPushNotification: PushNotification

public init(timestamp: Date, pushNotification: PushNotification) {
self.timestamp = timestamp
self.mbPushNotification = pushNotification
Expand All @@ -27,9 +27,14 @@ public struct PushNotification: Codable {
public let imageUrl: String?
public let payload: String?
public let uniqueKey: String?

var decodedPayload: Payload? {
guard let payloadData = payload?.data(using: .utf8) else { return nil }
return try? JSONDecoder().decode(Payload.self, from: payloadData)
}
}

public struct Payload: Codable {
var pushName: String
var pushDate: String
}

This file was deleted.

13 changes: 0 additions & 13 deletions Example/Podfile

This file was deleted.

72 changes: 27 additions & 45 deletions Example/README.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,47 @@
# Example app with SPM for Mindbox SDK for iOS
# Example app for Mindbox SDK for iOS

This is an example of SDK [integration](https://developers.mindbox.ru/docs/ios-sdk-integration)
This is an example of SDK [integration](https://developers.mindbox.ru/docs/ios-sdk).

## Getting started

### Launching the application
The app has integration via cocoapods, but you can use SPM if you need.
#### Cocoapods:

The app uses SPM to integrate the Mindbox SDK. Xcode will resolve and download the dependency when you open the project.

1. [Clone ios-sdk repository](https://github.com/mindbox-cloud/ios-sdk).
2. Make sure you have CocoaPods installed or install it according to the instructions.
3. Go to `ios-sdk/Example/`
4. Install the pods.
```ruby
pod update
```
Or
```ruby
pod install
```
5. Go to `ios-sdk/Example/Example.xcworkspace`.
6. Run file `Example.xcworkspace`.
#### SPM:
1. To deintegrate cocoapods you can use next comands:
- `sudo gem install cocoapods-deintegrate`
- `pod deintegrate`
- `rm Podfile`
- `rm Podfile.lock`
- `rm Example.xcworkspace`
- `rm -rf Pods`
2. Launch `Example.xcodeproj`.
3. [Read this](https://developers.mindbox.ru/docs/add-ios-sdk) and follow the initialization instructions via SPM.
2. Open `ios-sdk/Example/Example.xcodeproj`.
3. To ensure you have the latest SDK version: **File → Packages → Update to Latest Package Versions**.
4. Build and run.

Now you can test the in-app on the simulator.
In our admin panel there are already 3 ready-made in-apps that you can look at.
Now you can test the in-app on the simulator.
In our admin panel there are already 3 ready-made in-apps that you can look at.
To run the application on a real device and try push notifications, follow the instructions below.

### Setting up a Example application with your personal account (to run on a real device)
### Setting up the Example application with your personal account (to run on a real device)

1. Change [team](https://developers.mindbox.ru/docs/ios-get-keys) and bundle identifiers and App Group name for next targets:
- ExampleApp
- MindboxNotificationServiceExtension
- MindboxNotificationContentExtension
- ExampleApp
- MindboxNotificationServiceExtension
- MindboxNotificationContentExtension
2. [Configure your endpoints](https://developers.mindbox.ru/docs/add-ios-integration).
3. Change domain and endpoints in the `AppDelegate.swift` to yours.

### SDK functionality testing

1. To check innap when opening:
- [Read this](https://help.mindbox.ru/docs/in-app-what-is).
- Open app.
2. To check the inapp anywhere in the application:
- [Read this](https://help.mindbox.ru/docs/in-app-location).
- Replace `operationSystemName` in `showInAppWithExecuteSyncOperation` and `showInAppWithExecuteAsyncOperation` in MainViewModel.
- Click to the button `Show in-app` opposite the selected operation.
1. To check in-app when opening:
- [Read this](https://help.mindbox.ru/docs/in-apps).
- Open app.
2. To check the in-app anywhere in the application:
- [Read this](https://help.mindbox.ru/docs/in-app-location).
- Replace `operationSystemName` in `showInAppWithExecuteSyncOperation` and `showInAppWithExecuteAsyncOperation` in MainViewModel.
- Click to the button `Show in-app` opposite the selected operation.
3. To check push notifications:
- [Read this](https://developers.mindbox.ru/docs/ios-send-push-notifications-advanced)
- Send a notification from your account.
- [Read this](https://developers.mindbox.ru/docs/mobile-push-check)
- Send a notification from your account.
4. To check rich notifications:
- [Read this](https://developers.mindbox.ru/docs/ios-send-push-notifications-advanced)
- Send a notification from your account.
- [Read this](https://developers.mindbox.ru/docs/mobile-push-check)
- Send a notification from your account.

### Additionally
- Currently the In-App only comes once per session.
- There are comments and links in the ExampleApp code that can help you.
- Currently the In-App only comes once per session.
- There are comments and links in the ExampleApp code that can help you.
Loading