Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 0 additions & 4 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -461,14 +461,10 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n";
Expand Down
4 changes: 2 additions & 2 deletions Example/Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ final class AppDelegate: MindboxAppDelegate {
) {
// https://developers.mindbox.ru/docs/ios-sdk-methods
print("Is mindbox notification: \(Mindbox.shared.isMindboxPush(userInfo: response.notification.request.content.userInfo))")
if let mindboxPushNotification = Mindbox.shared.getMindboxPushData(userInfo: response.notification.request.content.userInfo),
Mindbox.shared.isMindboxPush(userInfo: response.notification.request.content.userInfo),
if Mindbox.shared.isMindboxPush(userInfo: response.notification.request.content.userInfo),
let mindboxPushNotification = Mindbox.shared.getMindboxPushData(userInfo: response.notification.request.content.userInfo),
let uniqueKey = mindboxPushNotification.uniqueKey {
Mindbox.shared.pushClicked(uniqueKey: uniqueKey)
}
Expand Down
20 changes: 18 additions & 2 deletions Example/Example/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,37 @@

import UIKit
import SwiftUI
import Mindbox

final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
final class SceneDelegate: MindboxSceneDelegate {

var window: UIWindow?

func scene(
override func scene(
_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions
) {
super.scene(scene, willConnectTo: session, options: connectionOptions)

guard let windowScene = (scene as? UIWindowScene) else { return }
let window = UIWindow(windowScene: windowScene)
let viewModel = MainViewModel()
window.rootViewController = UIHostingController(rootView: MainView(viewModel: viewModel))
self.window = window
window.makeKeyAndVisible()

// Handle Universal Link on a cold start:
// The app was launched from a URL (not already running).
// Read the link from `connectionOptions.userActivities` and route to the right screen.
}

// https://developers.mindbox.ru/docs/universal-links#ios
override func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
super.scene(scene, continue: userActivity)

// Handle Universal Link on a warm start:
// The app is already running (foreground or background) and receives a new URL.
// Use `scene(_:continue:)` to parse and route the link.
}
}
2 changes: 0 additions & 2 deletions Mindbox/MindboxSceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ import UIKit

@available(iOS 13.0, *)
open class MindboxSceneDelegate: UIResponder, UIWindowSceneDelegate {
open var window: UIWindow?

open func scene(
_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions
) {
Mindbox.shared.track(.launchScene(connectionOptions))
guard (scene as? UIWindowScene) != nil else { return }
}

open func scene(
Expand Down