Fix issues with OTP notification (#517)
* Use "Beta" since this is what Apple uses too * Actually copy the OTP if the option is set * Shorten notification text to make it fit to smaller screens * Set notification center delegate before app launches * Fix SwiftFormat issue fixed with version 0.48.12
This commit is contained in:
parent
32b7c9b635
commit
3eea063d61
7 changed files with 11 additions and 10 deletions
|
|
@ -28,10 +28,11 @@ public class NotificationCenterDispatcher: NSObject, UNUserNotificationCenterDel
|
|||
return
|
||||
}
|
||||
let content = UNMutableNotificationContent()
|
||||
content.title = "OTPForPassword".localize(password.name)
|
||||
if Defaults.autoCopyOTP {
|
||||
content.title = "OTPForPasswordCopied".localize(password.name)
|
||||
content.body = "OTPHasBeenCopied".localize()
|
||||
UIPasteboard.general.string = otp
|
||||
} else {
|
||||
content.title = "OTPForPassword".localize(password.name)
|
||||
content.body = otp
|
||||
content.categoryIdentifier = Globals.otpNotificationCategory
|
||||
content.userInfo = [
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class Parser {
|
|||
init(plainText: String) {
|
||||
let splittedPlainText = plainText.splitByNewline()
|
||||
|
||||
firstLine = splittedPlainText.first!
|
||||
self.firstLine = splittedPlainText.first!
|
||||
self.additionsSection = splittedPlainText[1...].joined(separator: "\n")
|
||||
self.purgedAdditionalLines = splittedPlainText[1...].filter { !$0.isEmpty }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue