From c1c10ce660ffba7cac2f3331717785608ec0edb7 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 19 Jun 2021 00:14:41 +0200 Subject: [PATCH] Add boop sound for notifications --- Mastodon.xcodeproj/project.pbxproj | 4 ++++ .../xcshareddata/swiftpm/Package.resolved | 6 +++--- Mastodon/Resources/BoopSound.caf | Bin 0 -> 9332 bytes NotificationService/NotificationService.swift | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 Mastodon/Resources/BoopSound.caf diff --git a/Mastodon.xcodeproj/project.pbxproj b/Mastodon.xcodeproj/project.pbxproj index 98caf277..e8177de1 100644 --- a/Mastodon.xcodeproj/project.pbxproj +++ b/Mastodon.xcodeproj/project.pbxproj @@ -28,6 +28,7 @@ 0FB3D31E25E534C700AAD544 /* PickServerCategoryCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0FB3D31D25E534C700AAD544 /* PickServerCategoryCollectionViewCell.swift */; }; 0FB3D33225E5F50E00AAD544 /* PickServerSearchCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0FB3D33125E5F50E00AAD544 /* PickServerSearchCell.swift */; }; 0FB3D33825E6401400AAD544 /* PickServerCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0FB3D33725E6401400AAD544 /* PickServerCell.swift */; }; + 164F0EBC267D4FE400249499 /* BoopSound.caf in Resources */ = {isa = PBXBuildFile; fileRef = 164F0EBB267D4FE400249499 /* BoopSound.caf */; }; 18BC7629F65E6DB12CB8416D /* Pods_Mastodon_MastodonUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C030226D3C73DCC23D67452 /* Pods_Mastodon_MastodonUITests.framework */; }; 2D04F42525C255B9003F936F /* APIService+PublicTimeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D04F42425C255B9003F936F /* APIService+PublicTimeline.swift */; }; 2D084B8D26258EA3003AA3AF /* NotificationViewModel+diffable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D084B8C26258EA3003AA3AF /* NotificationViewModel+diffable.swift */; }; @@ -595,6 +596,7 @@ 0FB3D31D25E534C700AAD544 /* PickServerCategoryCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PickServerCategoryCollectionViewCell.swift; sourceTree = ""; }; 0FB3D33125E5F50E00AAD544 /* PickServerSearchCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PickServerSearchCell.swift; sourceTree = ""; }; 0FB3D33725E6401400AAD544 /* PickServerCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PickServerCell.swift; sourceTree = ""; }; + 164F0EBB267D4FE400249499 /* BoopSound.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = BoopSound.caf; sourceTree = ""; }; 2D04F42425C255B9003F936F /* APIService+PublicTimeline.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "APIService+PublicTimeline.swift"; sourceTree = ""; }; 2D084B8C26258EA3003AA3AF /* NotificationViewModel+diffable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NotificationViewModel+diffable.swift"; sourceTree = ""; }; 2D084B9226259545003AA3AF /* NotificationViewModel+LoadLatestState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NotificationViewModel+LoadLatestState.swift"; sourceTree = ""; }; @@ -1680,6 +1682,7 @@ DB3D0FF825BAA6B200EAA174 /* Resources */ = { isa = PBXGroup; children = ( + 164F0EBB267D4FE400249499 /* BoopSound.caf */, DB427DDE25BAA00100D1B89D /* Assets.xcassets */, DB118A8125E4B6E600FAB162 /* Preview Assets.xcassets */, DB3D100F25BAA75E00EAA174 /* Localizable.strings */, @@ -2719,6 +2722,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 164F0EBC267D4FE400249499 /* BoopSound.caf in Resources */, DB427DE225BAA00100D1B89D /* LaunchScreen.storyboard in Resources */, DB3D100D25BAA75E00EAA174 /* Localizable.strings in Resources */, DB427DDF25BAA00100D1B89D /* Assets.xcassets in Resources */, diff --git a/Mastodon.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Mastodon.xcworkspace/xcshareddata/swiftpm/Package.resolved index 1ca83d0d..a64f6ed7 100644 --- a/Mastodon.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Mastodon.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -15,8 +15,8 @@ "repositoryURL": "https://github.com/Alamofire/Alamofire.git", "state": { "branch": null, - "revision": "f96b619bcb2383b43d898402283924b80e2c4bae", - "version": "5.4.3" + "revision": "4d19ad82f80cc71ff829b941ded114c56f4f604c", + "version": "5.4.2" } }, { @@ -60,7 +60,7 @@ "repositoryURL": "https://github.com/onevcat/Kingfisher.git", "state": { "branch": null, - "revision": "15d199e84677303a7004ed2c5ecaa1a90f3863f8", + "revision": "bbc4bc4def7eb05a7ba8e1219f80ee9be327334e", "version": "6.2.1" } }, diff --git a/Mastodon/Resources/BoopSound.caf b/Mastodon/Resources/BoopSound.caf new file mode 100644 index 0000000000000000000000000000000000000000..f0a3ebc420394579564cfe6ef50104347c432745 GIT binary patch literal 9332 zcmeHLL5$;88Gg=8xA81({hXoQ>>`xdp0Z0(wf1wUDtc(g84ldK?vcxC+DcW0fVL79 zr_8oMX1WDuOJQEJU4|BwiJbv$_Y~Xd9uN{8XL{k*ti%Nn(r`cpsiITHe7`e8xx%69 zA(oPO{NDTh|KI=p-~ZmMUVQRNrZD#S6VI-)=~a99Pwf`nKJ|@@?(`8e@cS@6n910; zEm?1DjV1~d9ff)ib z1ZD`#5SStG$sq9f#pfTrW8-H3%K~*`n5NMc;H+EQ{U@XuA4KpOeTNQj4OUX%9sj9SwrXVCt;VSQ_a7u%#3O<3R z;a=6QEGUx8yoGlt)lR^wJkV5_&^nsLit2T)$UxyI^VS?Y-RWp&IyJ_XpvqN6m0VE+ zsdVdC77!0?D-tm&odw>JxRPGsN4=HhcAc<_xLv*(=mPP5g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z!<%v#Uyb^*pRnP5SE}=0`GVrucl&LV-KMRyO7^8kZ+!iQ-Ww0y_%*wgq#LJCq_yqV zNUE2<*2vquZ|v}AK70PH@6Pu&do_RU!Fv`eSH;y!*Mg1h^9N`0mkw&d=H*xJ{P8tK zEtS3b>b+%SJA6d{-P0#d|Ni;!JfPg+v}Cde>@u{FQ#Q$_2aPujLu*4L#>u$UK&d5B z2=Vg^?W0BnHI4T`K&1Z0Ro{bus@%*S3OcU#GAP_c#Q`W;?xuTG$wfm#yY-qyK%}R2ww;Z~*_?&e0*=RhRU^&y zpk1_aP-FoHn(9ZtfYaeRKLUfwNavdwTrTPd9{=+ynisYcg+6&kUE4$-A}u8ilTx!A z2dA+mfN($uOr@Q?TZ~fvdK;$*Mo;8FYdWTdwe66=AXdTh26Lz#L3BK4?ixwta6H}k zKsv%MK%Vwu2Yl4q^NYjL-Xwu!5HY};#|kb(f2fo85pC%V$r=hi!mg%?_k!sF(x_vb zlV^EKbKKcom;WbvMQ_&$j0)ui-mJ63|| zZe|X*Rxaz{Yd>i!RJK`l7`+LDS#Iqco_}6BBay`EM~O-!HtU*CnD;tkW~AII}Qm@EDffqxs!t{DQKHU$0+ DA9;j2 literal 0 HcmV?d00001 diff --git a/NotificationService/NotificationService.swift b/NotificationService/NotificationService.swift index 5bc7252b..4e09e493 100644 --- a/NotificationService/NotificationService.swift +++ b/NotificationService/NotificationService.swift @@ -57,7 +57,7 @@ class NotificationService: UNNotificationServiceExtension { bestAttemptContent.title = notification.title bestAttemptContent.subtitle = "" bestAttemptContent.body = notification.body - bestAttemptContent.sound = .default + bestAttemptContent.sound = UNNotificationSound.init(named: UNNotificationSoundName(rawValue: "BoopSound.caf")) bestAttemptContent.userInfo["plaintext"] = plaintextData UserDefaults.shared.notificationBadgeCount += 1