Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove manual showing alerts & update podspec #9

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions App/DemoStoreApp.struct.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import SwiftUI
@main
struct DemoStoreApp: App {
@StateObject private var appState = AppState()
var window: UIWindow?

init() {
DependenciesInitialization.initialize()
Expand Down
8 changes: 0 additions & 8 deletions App/Views/Screens/HomeScreenView.struct.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ struct HomeScreenView: View {
recommendedProducts: viewModel.recommenderProducts,
title: NSLocalizedString("reccomender_title", comment: "")
)
Text("new_features_title")
.font(.headline)
.foregroundColor(AppColors.colorBlue)
.padding()
.frame(height: Sizes.Size.mediumImage)
.onTapGesture {
navigationManager.navigateToScreen(InAppNotificationScreen())
}
}
}
.padding(.vertical, Sizes.Padding.standard)
Expand Down
26 changes: 25 additions & 1 deletion Core/Presentation/ViewModel/SdkManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import REES46

class SDKManager: SDKManaging {
var sdk: PersonalizationSDK?
let parentVC = UIApplication.topViewController()

init() {
initializeSDK()
Expand All @@ -13,7 +14,9 @@ class SDKManager: SDKManaging {
apiDomain: AppConfigVariables.apiDomain,
stream: AppConfigVariables.sdkStream,
enableLogs: true,
autoSendPushToken: true
autoSendPushToken: true,
parentViewController:parentVC,
needReInitialization: true
) { error in
if let error = error {
print("SDK Initialization failed: \(error.localizedDescription)")
Expand All @@ -28,3 +31,24 @@ class SDKManager: SDKManaging {
}
}
}

import UIKit

extension UIApplication {
static func topViewController(base: UIViewController? = UIApplication.shared.connectedScenes
.flatMap { ($0 as? UIWindowScene)?.windows ?? [] }
.first { $0.isKeyWindow }?.rootViewController) -> UIViewController? {
if let nav = base as? UINavigationController {
return topViewController(base: nav.visibleViewController)
}
if let tab = base as? UITabBarController {
if let selected = tab.selectedViewController {
return topViewController(base: selected)
}
}
if let presented = base?.presentedViewController {
return topViewController(base: presented)
}
return base
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ class NotificationWidgetController: ObservableObject {
negativeButtonText: NSLocalizedString("notification_decline_button", comment: ""),
onPositiveButtonClick: {
print("Alert Accepted")
},
onNegativeButtonClick: {
print("Alert Declined")
}
)
}
Expand All @@ -34,9 +31,6 @@ class NotificationWidgetController: ObservableObject {
negativeButtonText: NSLocalizedString("notification_decline_button", comment: ""),
onPositiveButtonClick: {
print("Bottom Sheet Accepted")
},
onNegativeButtonClick: {
print("Bottom Sheet Declined")
}
)
}
Expand All @@ -50,9 +44,6 @@ class NotificationWidgetController: ObservableObject {
negativeButtonText: NSLocalizedString("notification_decline_button", comment: ""),
onPositiveButtonClick: {
print("Full Screen Alert Accepted")
},
onNegativeButtonClick: {
print("Full Screen Alert Declined")
}
)
}
Expand Down
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ platform :ios, '13.0'
target 'demo-store-ios' do
use_frameworks!

pod 'REES46', :git => 'https://github.com/rees46/ios-sdk.git', :branch => 'master', :tag => '3.6.40'
pod 'REES46', :git => 'https://github.com/rees46/ios-sdk.git', :branch => 'master', :tag => '3.6.44'
pod "Resolver"

end
Expand Down
14 changes: 7 additions & 7 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PODS:
- REES46 (3.6.40)
- REES46 (3.6.44)
- Resolver (1.5.1)

DEPENDENCIES:
- REES46 (from `https://github.com/rees46/ios-sdk.git`, branch `master`, tag `3.6.40`)
- REES46 (from `https://github.com/rees46/ios-sdk.git`, branch `master`, tag `3.6.44`)
- Resolver

SPEC REPOS:
Expand All @@ -14,18 +14,18 @@ EXTERNAL SOURCES:
REES46:
:branch: master
:git: https://github.com/rees46/ios-sdk.git
:tag: 3.6.40
:tag: 3.6.44

CHECKOUT OPTIONS:
REES46:
:commit: c4871cef4787f191d6afbdce6daedf43f1a65b8a
:commit: 9eb35cad6e2f5b4ec26db33c2b44c971eb8816dd
:git: https://github.com/rees46/ios-sdk.git
:tag: 3.6.40
:tag: 3.6.44

SPEC CHECKSUMS:
REES46: a10ed6d2091d2a44572ec7df65bec632d0e8fa3e
REES46: 7d70155d0abedfb5ea671859656803db4f14b0db
Resolver: 0e2ce51257e9366c54afe1b9e9be25059e9b9300

PODFILE CHECKSUM: c6a54df364be4afbc94df09d59602e9b9f5e1c33
PODFILE CHECKSUM: ea9fb2f3875fb93edabd7e0a5b0747c628fcaee9

COCOAPODS: 1.15.2
5 changes: 2 additions & 3 deletions Pods/Local Podspecs/REES46.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading