151 Commits
Author SHA1 Message Date
Leon Böttger 8837d0e0aa Refactoring 2025-07-24 19:17:32 +02:00
Leon Böttger 2939990607 Catch errors when storage is not sufficient 2025-07-24 15:34:48 +02:00
Leon Böttger 404e25d3bd Only allow one alert message at a time 2025-07-23 14:42:36 +02:00
Leon Böttger 23705c5e26 Unify main app + app extension logging 2025-07-23 14:21:58 +02:00
Leon Böttger 73e86ff65f Improve strings 2025-07-23 13:36:02 +02:00
Leon Böttger 7403e70893 Set creation date for images using EXIF 2025-06-29 18:58:58 +02:00
Leon Böttger 34d677fb92 Merge remote-tracking branch 'refs/remotes/fork/master' 2025-06-17 16:13:29 +02:00
Leon Böttger da10b8bbb8 Update strings 2025-06-17 16:12:33 +02:00
Leon Böttger ff08266e44 Merge pull request #1 from joaquincorradi/master
Fix Spanish translation: typos and improved consistency
2025-06-17 16:09:17 +02:00
joaquincorradi b6fdf61430 Fix typos in Spanish translation 2025-06-16 19:00:21 -03:00
Leon Böttger d743a5039a Fix welcome screen opened multiple times if app icon clicked multiple times 2025-06-03 20:56:01 +02:00
Leon Böttger f416f8f098 Add Version Number to Logging Export 2025-06-03 09:14:32 +02:00
Leon Böttger 90e3e23905 UI Improvements 2025-06-02 14:31:38 +02:00
Leon Böttger 98da599302 Comments 2025-05-30 21:11:50 +02:00
Leon Böttger c68ca3376b Try to fix issue if connection state update handler called early -> aborts connection 2025-05-30 21:11:04 +02:00
Leon Böttger 46997ab9fc Add check if connection already closed 2025-05-30 20:55:33 +02:00
Leon Böttger e5ae0c250e Add more logging 2025-05-30 19:43:48 +02:00
Leon Böttger 20af028cc3 Avoid calling disconnect twice 2025-05-30 19:33:09 +02:00
Leon Böttger f3f6616280 FIx warning 2025-05-30 19:18:56 +02:00
Leon Böttger 04b5b4228b Fix 2025-05-27 12:01:25 +02:00
Leon Böttger 62f9abb5e5 Add new hint for ap isolation issue view 2025-05-27 11:59:33 +02:00
Leon Böttger df7cdecda5 New links to android app 2025-05-27 11:51:16 +02:00
Leon Böttger d96cec2ab1 Switch back to old plus view 2025-05-24 09:46:51 +02:00
Leon Böttger 843bc56f69 Remove references about android app for now 2025-05-24 09:43:14 +02:00
Leon Böttger 82e401b87d More logging 2025-05-22 09:52:21 +02:00
Leon Böttger 711519ded5 Ap Isolation check only when opening troubleshooting 2025-05-18 12:22:34 +02:00
Leon Böttger 3ccb41ae0f Make open finder automatically an optional setting 2025-05-18 11:53:02 +02:00
Leon Böttger e710bcab47 Indicate if no network connection 2025-05-18 11:44:25 +02:00
Leon Böttger 815ea3396f Refactoring 2025-05-17 16:17:23 +02:00
Leon Böttger bf6093e299 Re-enable automatic AP isolation checker 2025-05-17 16:16:15 +02:00
Leon Böttger 7c18c73c82 Refactoring 2025-05-17 15:11:26 +02:00
Leon Böttger 65515eb2ce Always bring app in foreground if alerted 2025-05-17 15:08:03 +02:00
Leon Böttger 62d285364f Automatically open folder if file transfer finished 2025-05-17 15:01:22 +02:00
Leon Böttger 9a3d31ce3b Reformatting 2025-05-17 14:14:21 +02:00
Leon Böttger a4ddb9d6be Remove unnecassary code 2025-05-17 13:58:59 +02:00
Leon Böttger dd28d21134 Supporting sending of plain text 2025-05-17 13:58:31 +02:00
Leon Böttger 6b883e9457 Add detection of unsupported file type 2025-05-17 13:28:36 +02:00
Leon Böttger e7654313f3 Fix 2025-05-17 13:06:03 +02:00
Leon Böttger ab4af784c4 Copy text to clipboard 2025-05-17 13:00:42 +02:00
Leon Böttger dbca8d6434 Formatting 2025-05-17 11:08:38 +02:00
Leon Böttger 3a2a8c70b9 Fix UrlReady 2025-05-17 11:05:43 +02:00
Leon Böttger f800975607 Add support for sharing plain text 2025-05-17 11:00:14 +02:00
Leon Böttger a76983df36 New Plus Window 2025-05-17 10:04:54 +02:00
Leon Böttger 1cdcf0297d Disable AP Isolation check for now 2025-05-16 19:05:54 +02:00
Leon Böttger ca722b8894 Logs instead of prints 2025-05-16 13:19:01 +02:00
Leon Böttger 6e33998fb6 Remove unnecessary code 2025-05-16 13:00:35 +02:00
Leon Böttger cbcbb20077 Remove logging for malformed protobuf, remove hint about deleting partial received file errors, firewall alert opening only for specific error code 2025-05-16 12:58:57 +02:00
Leon Böttger 0115a6453e Network check if troubleshooting is opened 2025-05-16 11:39:44 +02:00
Leon Böttger 3522a64955 Skip Ipv6 check 2025-05-16 11:22:28 +02:00
Leon Böttger d9f23f9b44 Add network connection check 2025-05-16 10:47:39 +02:00
Leon Böttger 6f1c4f4cf9 Add hint about guest networks 2025-05-15 18:53:20 +02:00
Leon Böttger 6ea0782565 Fix router address button 2025-05-15 17:55:52 +02:00
Leon Böttger c18a240ab3 Translate and enable all alert views 2025-05-15 17:35:28 +02:00
Leon Böttger 399fc8810b Implement new firewall and filter warning view 2025-05-15 16:41:49 +02:00
Leon Böttger d82e02dffb Add code to enable firewall view 2025-05-15 11:29:58 +02:00
Leon Böttger bf9540a06b Fix typos 2025-05-15 11:05:12 +02:00
Leon Böttger 124d62594f Add IssueViews (no localization yet) 2025-05-15 11:01:23 +02:00
Leon Böttger 4c6c7cbd6a Add detection of firewall 2025-05-15 09:01:17 +02:00
Leon Böttger 11a66d0f8a Cleanup project files 2025-05-15 08:26:02 +02:00
Leon Böttger 73e273b790 Add self-tests 2025-05-15 08:21:43 +02:00
Leon Böttger c9140cf19f Add packet filter alert 2025-05-14 15:25:30 +02:00
Leon Böttger 6c6c79cdad Reformatting 2025-05-14 15:06:32 +02:00
Leon Böttger 05fa6043fe Refactoring 2025-05-14 14:59:16 +02:00
Leon Böttger b2180f9235 Remove hint about incoming connections 2025-05-14 14:57:05 +02:00
Leon Böttger f6452de763 If file transfer ends with error, close plus view 2025-05-14 14:50:43 +02:00
Leon Böttger 653fbeb096 Add support for multiple services 2025-05-13 13:19:15 +02:00
Leon Böttger e43e017803 Always log, not just in debug 2025-05-13 11:09:00 +02:00
Leon Böttger d055140364 Rephrase beta program 2025-05-13 11:03:45 +02:00
Leon Böttger c40841fc9b Reduce logging 2025-05-05 21:05:48 +02:00
Leon Böttger 58e488c0ad More logging to fix protobuf wrong error 2025-05-05 20:59:37 +02:00
Leon Böttger 088a3b5389 Send file as log 2025-05-05 09:49:46 +02:00
Leon Böttger 199621acf3 Fix logging 2025-05-05 09:36:08 +02:00
Leon Böttger 8f8d46f7aa Possibility to send bug report if connection fails 2025-05-03 19:34:12 +02:00
Leon Böttger 81a7ee06af Improve beta description 2025-05-03 18:17:23 +02:00
Leon Böttger 99c57e9927 Add fail check for deserialization error 2025-05-03 15:08:45 +02:00
Leon Böttger a810a59b20 Try to fix protobuf decoding error 2025-05-03 14:55:05 +02:00
Leon Böttger fd524adca1 Strings 2025-05-03 14:44:34 +02:00
Leon Böttger 0614ab56cd Add email open for logging string sending 2025-05-03 13:45:04 +02:00
Leon Böttger a2e3bf1603 Extend license 2025-05-03 11:49:06 +02:00
Leon Böttger 54bb6069d6 Formatting 2025-05-03 11:31:59 +02:00
Leon Böttger 383560ad43 Add hint about Android app 2025-05-03 11:28:51 +02:00
Leon Böttger aee59f6f47 Refactor 2025-04-05 20:29:08 +02:00
Leon Böttger 2ea08a8604 Refactoring 2025-04-05 19:12:43 +02:00
Leon Böttger 5a8f1561c9 Fix warning 2025-04-05 06:59:56 +02:00
Leon Böttger 4984311370 Show plus only after second transmission 2025-04-05 06:43:07 +02:00
Leon Böttger 6986b6ce2b Add startup banner 2025-04-04 21:07:30 +02:00
Leon Böttger b81a453b69 Keep only one endpoint id 2025-04-04 20:35:42 +02:00
Leon Böttger ce77e73428 Refactoring 2025-04-04 20:26:09 +02:00
Leon Böttger bb86ebc606 Fix if pending file takes too long 2025-04-04 20:21:17 +02:00
Leon Böttger c0fb5dd303 Open welcome if clicking again 2025-04-04 18:53:09 +02:00
Leon Böttger 63d838728f Update troubleshooting 2025-04-03 21:16:26 +02:00
Leon Böttger ba1f49a711 Temporarily put files in temp directory 2025-04-03 20:56:41 +02:00
Leon Böttger 867bf3fff5 Do not accept incoming transfer if already disconnected 2025-04-02 21:14:22 +02:00
Leon Böttger ca571096bc Add hint about sending clipboard 2025-03-26 20:32:26 +01:00
Leon Böttger bd5a0ae061 Cleanup menu bar 2025-03-26 19:15:59 +01:00
Leon Böttger a87387cd1d Add sending of clipboard 2025-03-26 19:02:38 +01:00
Leon Böttger ea324ea7d8 Add option to choose save directory & automatically accept files 2025-03-25 21:06:01 +01:00
Leon Böttger 164d351c4d Remove hotspot hint 2025-03-24 18:55:46 +01:00
Leon Böttger 955763c004 Remove unused code 2025-03-17 20:32:22 +01:00
Leon Böttger 8e4989e163 Fix 2025-03-16 15:33:59 +01:00
Leon Böttger 8ebebbda15 Fix cant close qr if opened manually 2025-03-16 15:18:14 +01:00
Leon Böttger b5d1233778 Adjust automatic qr view interval 2025-03-14 21:42:09 +01:00
Leon Böttger 45b89cd391 Tweak automatic qr code view appearing 2025-03-14 21:39:19 +01:00
Leon Böttger c5d4197562 Improve strings 2025-03-14 20:48:40 +01:00
Leon Böttger 1f5901ed38 Automatically open QR view if no devices found 2025-03-14 20:33:39 +01:00
Leon Böttger b0d4cc19c3 Fix previous device not cleared, use alert sheet 2025-03-14 20:28:44 +01:00
Leon Böttger 2b7782a44c Switch to sheet for qr view, simplify text 2025-03-13 21:26:16 +01:00
Leon Böttger 2b0b7113c2 Auto quit qr window for new device 2025-03-12 20:09:29 +01:00
Leon Böttger da4dd4cc79 Automatically launch main app if not running and extension run 2025-03-12 18:49:03 +01:00
Leon Böttger 5ee4689893 Fix crash 2025-03-12 07:44:50 +01:00
Leon Böttger 8d8d4036dd Fix device not appearing in share extension 2025-03-12 07:37:29 +01:00
Leon Böttger d399f5f99a Remove Scrollview background 2025-03-12 07:23:43 +01:00
Leon Böttger 4bea296541 Better hint for QR view 2025-03-11 21:15:52 +01:00
Leon Böttger eb71cf76a9 Automatically zip if a folder should be uploaded 2025-03-11 20:58:58 +01:00
Leon Böttger 29f0d419a5 Add hint for sharing folders 2025-03-11 20:20:00 +01:00
Leon Böttger 3e8accaade Fix empty device name 2025-03-11 07:30:03 +01:00
Leon Böttger 3fb926ce52 Auto-close qr when device selected 2025-03-11 06:51:54 +01:00
Leon Böttger eeedb06027 Auto-close qr view 2025-03-11 06:50:46 +01:00
Leon Böttger 4a13fd049f Fix strings, share menu 2025-03-10 21:40:50 +01:00
Leon Böttger 89d892eea9 Add QR code 2025-03-10 21:34:42 +01:00
Leon Böttger af26ffc88f Add Download Folder hint 2025-03-10 19:22:27 +01:00
Leon Böttger ff6bc4d780 Improve strings 2025-03-09 20:45:46 +01:00
Leon Böttger 5d07cf1ae5 Fix BG 2025-03-09 18:45:11 +01:00
Leon Böttger f4ddb7b776 Improve strings 2025-03-08 21:46:08 +01:00
Leon Böttger ff66234223 Add missing translations 2025-03-08 21:31:31 +01:00
Leon Böttger af2dbc8c2d Add new sidebar for help 2025-03-08 21:12:56 +01:00
Leon Böttger 4743424ac4 fix strings 2025-03-02 12:02:07 +01:00
Leon Böttger ed381c56a6 Fix Strings 2025-03-02 11:22:45 +01:00
Leon Böttger 34583fbd05 fix 2025-03-02 07:55:59 +01:00
Leon Böttger 1f959b5bb0 Add further troubleshoting hint 2025-03-02 07:49:37 +01:00
Leon Böttger 753827e6c3 Add support menu item 2025-03-02 07:30:01 +01:00
Leon Böttger d6658498ba New sound for incoming transfer 2025-03-01 21:21:52 +01:00
Leon Böttger 46b45cd3f7 Refactoring 2025-03-01 18:58:02 +01:00
Leon Böttger 0c3ccc278a Fix restore 2025-03-01 18:56:18 +01:00
Leon Böttger 406f1ab78b Fix IA Converter 2025-03-01 18:06:57 +01:00
Leon Böttger 4929a96134 New Alert for receiving files, rename to QuickDrop 2025-03-01 16:06:08 +01:00
Leon Böttger 79b359fb64 Only show accept button 2025-02-23 20:38:34 +01:00
Leon Böttger 2ef0d0b058 Fix translations 2025-01-12 21:24:17 +01:00
Leon Böttger fd3ca7872e Fix strings 2025-01-12 20:00:31 +01:00
Leon Böttger 61ca2648bb Bump version 2025-01-12 19:51:28 +01:00
Leon Böttger 583a377655 Only request review every 20 incoming shares 2025-01-12 19:48:19 +01:00
Leon Böttger 83468e46f7 Merge remote-tracking branch 'refs/remotes/origin/master' 2025-01-12 19:43:46 +01:00
Leon Böttger 1713ef28d4 Add Review Controller, more translations 2025-01-12 19:43:33 +01:00
Leon Böttger 7bf12bd2f4 Update README.md 2025-01-11 22:23:35 +01:00
Leon Böttger 61e1fe38e6 Update README.md 2025-01-11 19:20:43 +01:00
Leon Böttger 1fb0d86545 Update README.md 2025-01-11 19:19:43 +01:00
Leon Böttger 037f1117e4 Update README.md 2025-01-09 10:50:04 +01:00
Leon Böttger c28a69ff42 Clarify strings 2025-01-04 21:22:46 +01:00
Leon Böttger e6fc89d050 Fix notifications not always shown 2025-01-04 20:04:47 +01:00
Leon Böttger 6da986a974 New Menubar icon, show welcome screen only on first launch 2025-01-04 19:59:11 +01:00
Leon Böttger 90bfcda2f8 Add Welcome Screen, Tweak App Icon 2025-01-04 19:39:11 +01:00
277 changed files with 9589 additions and 3613 deletions

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.
@@ -1,41 +0,0 @@
{
"pins" : [
{
"identity" : "asn1",
"kind" : "remoteSourceControl",
"location" : "https://github.com/leif-ibsen/ASN1",
"state" : {
"revision" : "555922e06f1835863d4c0143eb00d0097bcfc707",
"version" : "2.0.3"
}
},
{
"identity" : "bigint",
"kind" : "remoteSourceControl",
"location" : "https://github.com/leif-ibsen/BigInt",
"state" : {
"revision" : "47903c6b2dd2cb3b4484d4524676a2ca8723a871",
"version" : "1.9.0"
}
},
{
"identity" : "swift-protobuf",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-protobuf.git",
"state" : {
"revision" : "0af9125c4eae12a4973fb66574c53a54962a9e1e",
"version" : "1.21.0"
}
},
{
"identity" : "swiftecc",
"kind" : "remoteSourceControl",
"location" : "https://github.com/leif-ibsen/SwiftECC",
"state" : {
"revision" : "55493f0609f07b24bf6cd52b90898ed1cefb268e",
"version" : "3.5.3"
}
}
],
"version" : 2
}
-140
View File
@@ -1,140 +0,0 @@
//
// AppDelegate.swift
// NearDrop
//
// Created by Grishka on 08.04.2023.
//
import Cocoa
import UserNotifications
import NearbyShare
@main
class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDelegate, MainAppDelegate{
private var statusItem:NSStatusItem?
private var activeIncomingTransfers:[String:TransferInfo]=[:]
func applicationDidFinishLaunching(_ aNotification: Notification) {
let menu=NSMenu()
menu.addItem(withTitle: NSLocalizedString("VisibleToEveryone", value: "Visible to everyone", comment: ""), action: nil, keyEquivalent: "")
menu.addItem(withTitle: String(format: NSLocalizedString("DeviceName", value: "Device name: %@", comment: ""), arguments: [Host.current().localizedName!]), action: nil, keyEquivalent: "")
menu.addItem(NSMenuItem.separator())
menu.addItem(withTitle: NSLocalizedString("Quit", value: "Quit NearDrop", comment: ""), action: #selector(NSApplication.terminate(_:)), keyEquivalent: "")
statusItem=NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
statusItem?.button?.image=NSImage(named: "MenuBarIcon")
statusItem?.menu=menu
statusItem?.behavior = .removalAllowed
let nc=UNUserNotificationCenter.current()
nc.requestAuthorization(options: [.alert, .sound]) { granted, err in
if !granted{
DispatchQueue.main.async {
self.showNotificationsDeniedAlert()
}
}
}
nc.delegate=self
let incomingTransfersCategory=UNNotificationCategory(identifier: "INCOMING_TRANSFERS", actions: [
UNNotificationAction(identifier: "ACCEPT", title: NSLocalizedString("Accept", comment: ""), options: UNNotificationActionOptions.authenticationRequired),
UNNotificationAction(identifier: "DECLINE", title: NSLocalizedString("Decline", comment: ""))
], intentIdentifiers: [])
let errorsCategory=UNNotificationCategory(identifier: "ERRORS", actions: [], intentIdentifiers: [])
nc.setNotificationCategories([incomingTransfersCategory, errorsCategory])
NearbyConnectionManager.shared.mainAppDelegate=self
NearbyConnectionManager.shared.becomeVisible()
}
func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
statusItem?.isVisible=true
return true
}
func applicationWillTerminate(_ aNotification: Notification) {
UNUserNotificationCenter.current().removeAllDeliveredNotifications()
}
func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
return true
}
func showNotificationsDeniedAlert(){
let alert=NSAlert()
alert.alertStyle = .critical
alert.messageText=NSLocalizedString("NotificationsDenied.Title", value: "Notification Permission Required", comment: "")
alert.informativeText=NSLocalizedString("NotificationsDenied.Message", value: "NearDrop needs to be able to display notifications for incoming file transfers. Please allow notifications in System Settings.", comment: "")
alert.addButton(withTitle: NSLocalizedString("NotificationsDenied.OpenSettings", value: "Open settings", comment: ""))
alert.addButton(withTitle: NSLocalizedString("Quit", value: "Quit NearDrop", comment: ""))
let result=alert.runModal()
if result==NSApplication.ModalResponse.alertFirstButtonReturn{
NSWorkspace.shared.open(URL(string: "x-apple.systempreferences:com.apple.preference.notifications")!)
}else if result==NSApplication.ModalResponse.alertSecondButtonReturn{
NSApplication.shared.terminate(nil)
}
}
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
let transferID=response.notification.request.content.userInfo["transferID"]! as! String
NearbyConnectionManager.shared.submitUserConsent(transferID: transferID, accept: response.actionIdentifier=="ACCEPT")
if response.actionIdentifier != "ACCEPT"{
activeIncomingTransfers.removeValue(forKey: transferID)
}
completionHandler()
}
func obtainUserConsent(for transfer: TransferMetadata, from device: RemoteDeviceInfo) {
let fileStr:String
if let textTitle=transfer.textDescription{
fileStr=textTitle
}else if transfer.files.count==1{
fileStr=transfer.files[0].name
}else{
fileStr=String.localizedStringWithFormat(NSLocalizedString("NFiles", value: "%d files", comment: ""), transfer.files.count)
}
let notificationContent=UNMutableNotificationContent()
notificationContent.title="NearDrop"
notificationContent.subtitle=String(format:NSLocalizedString("PinCode", value: "PIN: %@", comment: ""), arguments: [transfer.pinCode!])
notificationContent.body=String(format: NSLocalizedString("DeviceSendingFiles", value: "%1$@ is sending you %2$@", comment: ""), arguments: [device.name, fileStr])
notificationContent.sound = .default
notificationContent.categoryIdentifier="INCOMING_TRANSFERS"
notificationContent.userInfo=["transferID": transfer.id]
if #available(macOS 11.0, *){
NDNotificationCenterHackery.removeDefaultAction(notificationContent)
}
let notificationReq=UNNotificationRequest(identifier: "transfer_"+transfer.id, content: notificationContent, trigger: nil)
UNUserNotificationCenter.current().add(notificationReq)
self.activeIncomingTransfers[transfer.id]=TransferInfo(device: device, transfer: transfer)
}
func incomingTransfer(id: String, didFinishWith error: Error?) {
guard let transfer=self.activeIncomingTransfers[id] else {return}
if let error=error{
let notificationContent=UNMutableNotificationContent()
notificationContent.title=String(format: NSLocalizedString("TransferError", value: "Failed to receive files from %@", comment: ""), arguments: [transfer.device.name])
if let ne=(error as? NearbyError){
switch ne{
case .inputOutput:
notificationContent.body="I/O Error";
case .protocolError(_):
notificationContent.body=NSLocalizedString("Error.Protocol", value: "Communication error", comment: "")
case .requiredFieldMissing:
notificationContent.body=NSLocalizedString("Error.Protocol", value: "Communication error", comment: "")
case .ukey2:
notificationContent.body=NSLocalizedString("Error.Crypto", value: "Encryption error", comment: "")
case .canceled(reason: _):
break; // can't happen for incoming transfers
}
}else{
notificationContent.body=error.localizedDescription
}
notificationContent.categoryIdentifier="ERRORS"
UNUserNotificationCenter.current().add(UNNotificationRequest(identifier: "transferError_"+id, content: notificationContent, trigger: nil))
}
UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: ["transfer_"+id])
self.activeIncomingTransfers.removeValue(forKey: id)
}
}
struct TransferInfo{
let device:RemoteDeviceInfo
let transfer:TransferMetadata
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1005 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

-42
View File
@@ -1,42 +0,0 @@
/* No comment provided by engineer. */
"Accept" = "Accept";
/* No comment provided by engineer. */
"Decline" = "Decline";
/* No comment provided by engineer. */
"DeviceName" = "Device name: %@";
/* No comment provided by engineer. */
"DeviceSendingFiles" = "%1$@ is sending you %2$@";
/* No comment provided by engineer. */
"Error.Crypto" = "Encryption error";
/* No comment provided by engineer. */
"Error.Protocol" = "Communication error";
/* No comment provided by engineer. */
"NFiles" = "%d files";
/* No comment provided by engineer. */
"NotificationsDenied.Message" = "NearDrop needs to be able to display notifications for incoming file transfers. Please allow notifications in System Settings.";
/* No comment provided by engineer. */
"NotificationsDenied.OpenSettings" = "Open settings";
/* No comment provided by engineer. */
"NotificationsDenied.Title" = "Notification Permission Required";
/* No comment provided by engineer. */
"PinCode" = "PIN: %@";
/* No comment provided by engineer. */
"Quit" = "Quit NearDrop";
/* No comment provided by engineer. */
"TransferError" = "Failed to receive files from %@";
/* No comment provided by engineer. */
"VisibleToEveryone" = "Visible to everyone";
-19
View File
@@ -1,19 +0,0 @@
//
// NDNotificationCenterHackery.h
// NearDrop
//
// Created by Grishka on 10.04.2023.
//
#import <Foundation/Foundation.h>
#import <UserNotifications/UserNotifications.h>
NS_ASSUME_NONNULL_BEGIN
@interface NDNotificationCenterHackery : NSObject
+ (void)removeDefaultAction:(UNMutableNotificationContent*) content;
@end
NS_ASSUME_NONNULL_END
-42
View File
@@ -1,42 +0,0 @@
//
// NDNotificationCenterHackery.m
// NearDrop
//
// Created by Grishka on 10.04.2023.
//
#import <UserNotifications/UserNotifications.h>
#import <AppKit/AppKit.h>
#import "NDNotificationCenterHackery.h"
@interface UNMutableNotificationCategory : UNNotificationCategory
@property(copy) NSString *actionsMenuTitle;
@property(copy) UNNotificationAction *alternateAction;
@property(copy) NSArray *minimalActions;
@property unsigned long long backgroundStyle;
@property(copy) NSArray *actions;
@end
@interface UNNotificationIcon : NSObject
+ (id)iconForApplicationIdentifier:(id)arg1;
+ (id)iconAtPath:(id)arg1;
+ (id)iconNamed:(id)arg1;
@end
@interface UNMutableNotificationContent (NDPrivateAPIs)
@property BOOL hasDefaultAction;
@property(copy) NSString *defaultActionTitle;
@property(copy) NSString *header;
@property (assign,nonatomic) BOOL shouldDisplayActionsInline;
@property (assign,nonatomic) BOOL shouldShowSubordinateIcon;
@property (nonatomic,copy) NSString * accessoryImageName;
@property(copy) UNNotificationIcon *icon;
@end
@implementation NDNotificationCenterHackery
+ (void)removeDefaultAction:(UNMutableNotificationContent*) content{
content.hasDefaultAction=false;
}
@end
Loaded 100 of 277 files, more files were not shown because too many files have changed in this diff. Show more