-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1294 from WalletConnect/feature/icon-from-notific…
…ation-types [Sample] Icons from notification types
- Loading branch information
Showing
11 changed files
with
132 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
Sources/WalletConnectNotify/Client/Wallet/NotifyImageUrls.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
import Foundation | ||
|
||
public struct NotifyImageUrls: Codable, Equatable { | ||
|
||
public let sm: String? | ||
public let md: String? | ||
public let lg: String? | ||
|
||
public init(sm: String? = nil, md: String? = nil, lg: String? = nil) { | ||
self.sm = sm | ||
self.md = md | ||
self.lg = lg | ||
} | ||
|
||
public init?(icons: [String]) { | ||
guard icons.count == 3 else { return nil } | ||
self.sm = icons[0] | ||
self.md = icons[1] | ||
self.lg = icons[2] | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
Sources/WalletConnectNotify/Client/Wallet/NotifySqliteFactory.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import Foundation | ||
|
||
struct NotifySqliteFactory { | ||
|
||
static func create(appGroup: String) -> Sqlite { | ||
let databasePath = databasePath(appGroup: appGroup, database: "notify_v\(version).db") | ||
let sqlite = DiskSqlite(path: databasePath) | ||
return sqlite | ||
} | ||
|
||
static func databasePath(appGroup: String, database: String) -> String { | ||
guard let path = FileManager.default | ||
.containerURL(forSecurityApplicationGroupIdentifier: appGroup)? | ||
.appendingPathComponent(database) else { | ||
|
||
fatalError("Database path not exists") | ||
} | ||
|
||
return path.absoluteString | ||
} | ||
|
||
static var version: String { | ||
return "1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters