Swift notification plugin (#436)

* Add Swift notification plugin

* Hash the metadata

* Validate min sendable amount

* Remove initializer as base class, UNNotificationServiceExtension, has no default initializer

* Set the PaymentMethod

* Handle PaymentDetails in SwapUpdated

* Improve payment text
This commit is contained in:
Ross Savage
2024-08-30 09:20:13 +02:00
committed by GitHub
parent 0053007000
commit b493f3dc03
12 changed files with 600 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import Foundation
public class ResourceHelper {
public static let shared = ResourceHelper()
private init() {/* must use shared instance */}
public func getString(key: String, fallback: String) -> String {
return getString(key: key, validateContains: nil, fallback: fallback)
}
public func getString(key: String, validateContains: String?, fallback: String) -> String {
if let str = Bundle.main.object(forInfoDictionaryKey: key) as? String {
if validateContains == nil || str.contains(validateContains!) {
return str
}
}
return fallback
}}