Skip to content

Commit

Permalink
Merge pull request #402 from Adamant-im/release/3.3.0
Browse files Browse the repository at this point in the history
Release 3.3.0
  • Loading branch information
StanislavDevIOS authored Dec 18, 2023
2 parents 658288a + d2806cb commit 7c35535
Show file tree
Hide file tree
Showing 467 changed files with 12,640 additions and 9,207 deletions.
763 changes: 568 additions & 195 deletions Adamant.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions Adamant.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,17 @@
"repositoryURL": "https://github.com/google/GoogleDataTransport.git",
"state": {
"branch": null,
"revision": "98a00258d4518b7521253a70b7f70bb76d2120fe",
"version": "9.2.4"
"revision": "aae45a320fd0d11811820335b1eabc8753902a40",
"version": "9.2.5"
}
},
{
"package": "GoogleUtilities",
"repositoryURL": "https://github.com/google/GoogleUtilities.git",
"state": {
"branch": null,
"revision": "4446686bc3714d49ce043d0f68318f42ed718cb6",
"version": "7.11.4"
"revision": "bc27fad73504f3d4af235de451f02ee22586ebd3",
"version": "7.12.1"
}
},
{
Expand All @@ -141,8 +141,8 @@
"repositoryURL": "https://github.com/nathantannar4/InputBarAccessoryView",
"state": {
"branch": null,
"revision": "039a9cb3ae8c5bc4d39242a6aa688b88023633d3",
"version": "6.2.0"
"revision": "17ced92a5dccb36512b408b6276353631d7cbe57",
"version": "6.3.0"
}
},
{
Expand All @@ -159,8 +159,8 @@
"repositoryURL": "https://github.com/firebase/leveldb.git",
"state": {
"branch": null,
"revision": "0706abcc6b0bd9cedfbb015ba840e4a780b5159b",
"version": "1.22.2"
"revision": "9d108e9112aa1d65ce508facf804674546116d9c",
"version": "1.22.3"
}
},
{
Expand All @@ -177,8 +177,8 @@
"repositoryURL": "https://github.com/MessageKit/MessageKit.git",
"state": {
"branch": null,
"revision": "14bfa7eb9f93267c3d7b8cdf58615bba27be672a",
"version": "4.1.1"
"revision": "1993e8e90d4e9a61b8d9bc8ceb733964ce943376",
"version": "4.2.0"
}
},
{
Expand Down Expand Up @@ -276,7 +276,7 @@
"repositoryURL": "https://github.com/socketio/socket.io-client-swift",
"state": {
"branch": "master",
"revision": "a1ed825835a2d8c2555938e96557ccc05e4bebf3",
"revision": "175da8b5156f6b132436f0676cc84c2f6a766b6e",
"version": null
}
},
Expand All @@ -285,17 +285,17 @@
"repositoryURL": "https://github.com/daltoniam/Starscream",
"state": {
"branch": null,
"revision": "df8d82047f6654d8e4b655d1b1525c64e1059d21",
"version": "4.0.4"
"revision": "ac6c0fc9da221873e01bd1a0d4818498a71eef33",
"version": "4.0.6"
}
},
{
"package": "SwiftProtobuf",
"repositoryURL": "https://github.com/apple/swift-protobuf.git",
"state": {
"branch": null,
"revision": "ce20dc083ee485524b802669890291c0d8090170",
"version": "1.22.1"
"revision": "07f7f26ded8df9645c072f220378879c4642e063",
"version": "1.25.1"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,10 @@
<attribute name="name" optional="YES" attributeType="String"/>
<relationship name="transfers" optional="YES" toMany="YES" deletionRule="Cascade" destinationEntity="BaseTransaction" inverseName="partner" inverseEntity="BaseTransaction"/>
</entity>
<entity name="BaseTransaction" representedClassName="BaseTransaction" isAbstract="YES" syncable="YES">
<attribute name="amount" optional="YES" attributeType="Decimal" defaultValueString="0"/>
<attribute name="blockId" optional="YES" attributeType="String"/>
<attribute name="confirmations" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="date" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="fee" optional="YES" attributeType="Decimal" defaultValueString="0"/>
<attribute name="height" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="isConfirmed" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="isOutgoing" attributeType="Boolean" usesScalarValueType="YES"/>
<attribute name="recipientId" attributeType="String"/>
<attribute name="senderId" attributeType="String"/>
<entity name="BaseTransaction" representedClassName="BaseTransaction" isAbstract="YES" parentEntity="CoinTransaction" syncable="YES">
<attribute name="senderPublicKey" optional="YES" attributeType="String"/>
<attribute name="transactionId" attributeType="String"/>
<attribute name="type" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<relationship name="partner" maxCount="1" deletionRule="Nullify" destinationEntity="BaseAccount" inverseName="transfers" inverseEntity="BaseAccount"/>
<uniquenessConstraints>
<uniquenessConstraint>
<constraint value="transactionId"/>
</uniquenessConstraint>
</uniquenessConstraints>
</entity>
<entity name="Chatroom" representedClassName="Chatroom" syncable="YES">
<attribute name="hasUnreadMessages" optional="YES" attributeType="Boolean" usesScalarValueType="YES"/>
Expand All @@ -42,6 +26,7 @@
</entity>
<entity name="ChatTransaction" representedClassName="ChatTransaction" isAbstract="YES" parentEntity="BaseTransaction" syncable="YES">
<attribute name="chatMessageId" attributeType="String"/>
<attribute name="isFake" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="isHidden" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="isUnread" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="showsChatroom" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES"/>
Expand All @@ -50,6 +35,27 @@
<relationship name="chatroom" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="Chatroom" inverseName="transactions" inverseEntity="Chatroom"/>
<relationship name="lastIn" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="Chatroom" inverseName="lastTransaction" inverseEntity="Chatroom"/>
</entity>
<entity name="CoinTransaction" representedClassName="CoinTransaction" isAbstract="YES" syncable="YES">
<attribute name="amount" optional="YES" attributeType="Decimal" defaultValueString="0.0"/>
<attribute name="blockchainType" attributeType="String" defaultValueString=""/>
<attribute name="blockId" optional="YES" attributeType="String"/>
<attribute name="coinId" optional="YES" attributeType="String"/>
<attribute name="confirmations" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="date" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="fee" optional="YES" attributeType="Decimal" defaultValueString="0.0"/>
<attribute name="height" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="isConfirmed" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="isOutgoing" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="recipientId" attributeType="String" defaultValueString=""/>
<attribute name="senderId" attributeType="String" defaultValueString=""/>
<attribute name="transactionId" attributeType="String" defaultValueString=""/>
<attribute name="transactionStatusRaw" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<uniquenessConstraints>
<uniquenessConstraint>
<constraint value="transactionId"/>
</uniquenessConstraint>
</uniquenessConstraints>
</entity>
<entity name="CoreDataAccount" representedClassName="CoreDataAccount" parentEntity="BaseAccount" syncable="YES">
<attribute name="publicKey" attributeType="String"/>
<relationship name="chatroom" maxCount="1" deletionRule="Cascade" destinationEntity="Chatroom" inverseName="partner" inverseEntity="Chatroom"/>
Expand Down
37 changes: 12 additions & 25 deletions Adamant/AppDelegate.swift → Adamant/App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ extension StoreKey {
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var repeater: RepeaterService!
var container: Container!
var container: AppContainer!
var screensFactory: ScreensFactory!

// MARK: Dependencies
var accountService: AccountService!
Expand All @@ -57,8 +58,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
KeychainStore.migrateIfNeeded()

// MARK: 1. Initiating Swinject
container = Container()
container.registerAdamantServices()
container = AppContainer()
screensFactory = AdamantScreensFactory(assembler: container.assembler)
accountService = container.resolve(AccountService.self)
notificationService = container.resolve(NotificationsService.self)
dialogService = container.resolve(DialogService.self)
Expand Down Expand Up @@ -93,16 +94,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
window.tintColor = UIColor.adamant.primary

// MARK: 3. Prepare pages
guard let router = container.resolve(Router.self) else {
fatalError("Failed to get Router")
}

let chatList = UINavigationController(
rootViewController: router.get(scene: AdamantScene.Chats.chatList)
rootViewController: screensFactory.makeChatList()
)

let account = UINavigationController(
rootViewController: router.get(scene: AdamantScene.Account.account)
rootViewController: screensFactory.makeAccount()
)

let tabScreens: TabScreens = UIScreen.main.traitCollection.userInterfaceIdiom == .pad
Expand Down Expand Up @@ -156,15 +153,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
dialogService.setup(window: window)

// MARK: 5. Show login
let login = router.get(scene: AdamantScene.Login.login) as! LoginViewController
let login = screensFactory.makeLogin()
let welcomeIsShown = UserDefaults.standard.bool(forKey: StoreKey.application.welcomeScreensIsShown)

login.requestBiometryOnFirstTimeActive = welcomeIsShown
login.modalPresentationStyle = .overFullScreen
window.rootViewController?.present(login, animated: false, completion: nil)

if !welcomeIsShown {
let welcome = router.get(scene: AdamantScene.Onboard.welcome)
let welcome = screensFactory.makeOnboard()
welcome.modalPresentationStyle = .overFullScreen
login.present(welcome, animated: true, completion: nil)
UserDefaults.standard.set(true, forKey: StoreKey.application.welcomeScreensIsShown)
Expand Down Expand Up @@ -205,7 +202,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}

// Setup transactions statuses observing
if let service = container.resolve(RichTransactionStatusService.self) {
if let service = container.resolve(TransactionStatusService.self) {
Task { await service.startObserving() }
}

Expand Down Expand Up @@ -443,8 +440,7 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
// MARK: - Background Fetch
extension AppDelegate {
func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
let container = Container()
container.registerAdamantServices()
let container = AppContainer()

guard let notificationsService = container.resolve(NotificationsService.self) else {
UIApplication.shared.setMinimumBackgroundFetchInterval(UIApplication.backgroundFetchIntervalNever)
Expand Down Expand Up @@ -621,11 +617,7 @@ extension AppDelegate {
var chatList: UINavigationController?
var chatDetail: ChatListViewController?

guard let tabbar = window?.rootViewController as? UITabBarController,
let router = container.resolve(Router.self)
else {
return
}
guard let tabbar = window?.rootViewController as? UITabBarController else { return }

if let split = tabbar.viewControllers?.first as? UISplitViewController,
let navigation = split.viewControllers.first as? UINavigationController,
Expand All @@ -652,7 +644,6 @@ extension AppDelegate {
with: adamantAdr,
chatList: chatList,
tabbar: tabbar,
router: router,
chatDetail: chatDetail
)
}
Expand All @@ -663,17 +654,13 @@ extension AppDelegate {
with adamantAdr: AdamantAddress,
chatList: UINavigationController,
tabbar: UITabBarController,
router: Router,
chatDetail: ChatListViewController
) {
chatList.popToRootViewController(animated: false)
chatList.dismiss(animated: false, completion: nil)
tabbar.selectedIndex = 0

let newChat = router.get(scene: AdamantScene.Chats.newChat) as? NewChatViewController

guard let newChat = newChat else { return }

let newChat = screensFactory.makeNewChat()
newChat.delegate = chatDetail.self

if let split = chatDetail.splitViewController {
Expand Down
Loading

0 comments on commit 7c35535

Please sign in to comment.