Fix notification service extension bug

This commit is contained in:
gmbnt 2020-04-07 10:04:59 +10:00
parent 37865bab96
commit c432af93dc
3 changed files with 7 additions and 7 deletions

View File

@ -25,7 +25,7 @@
<key>NSExtensionPointIdentifier</key>
<string>com.apple.usernotifications.service</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).NotificationService</string>
<string>$(PRODUCT_MODULE_NAME).NotificationServiceExtension</string>
</dict>
</dict>
</plist>

View File

@ -2,7 +2,7 @@ import UserNotifications
import SignalServiceKit
import SignalMessaging
final class NotificationService : UNNotificationServiceExtension {
final class NotificationServiceExtension : UNNotificationServiceExtension {
static let isFromRemoteKey = "remote"
static let threadIdKey = "Signal.AppNotificationsUserInfoKey.threadId"
@ -67,7 +67,7 @@ final class NotificationService : UNNotificationServiceExtension {
groupType: oldGroupModel.groupType,
adminIds: group.admins)
removeMembers.subtract(Set(arrayLiteral: newGroupModel.groupMemberIds))
newGroupModel.removedMembers = removeMembers as! NSMutableSet
newGroupModel.removedMembers = NSMutableSet(set: removeMembers)
switch contentProto?.dataMessage?.group?.type {
case .update:
newNotificationBody = oldGroupModel.getInfoStringAboutUpdate(to: newGroupModel, contactsManager: SSKEnvironment.shared.contactsManager)

View File

@ -520,7 +520,7 @@
768A1A2B17FC9CD300E00ED8 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 768A1A2A17FC9CD300E00ED8 /* libz.dylib */; };
76C87F19181EFCE600C4ACAB /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76C87F18181EFCE600C4ACAB /* MediaPlayer.framework */; };
76EB054018170B33006006FC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB03C318170B33006006FC /* AppDelegate.m */; };
7BC01A3E241F40AB00BC7C55 /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BC01A3D241F40AB00BC7C55 /* NotificationService.swift */; };
7BC01A3E241F40AB00BC7C55 /* NotificationServiceExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BC01A3D241F40AB00BC7C55 /* NotificationServiceExtension.swift */; };
7BC01A42241F40AB00BC7C55 /* LokiPushNotificationService.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 7BC01A3B241F40AB00BC7C55 /* LokiPushNotificationService.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
7BDCFC08242186E700641C39 /* NotificationServiceExtensionContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BDCFC07242186E700641C39 /* NotificationServiceExtensionContext.swift */; };
7BDCFC092421894900641C39 /* MessageFetcherJob.swift in Sources */ = {isa = PBXBuildFile; fileRef = 452ECA4C1E087E7200E2F016 /* MessageFetcherJob.swift */; };
@ -1360,7 +1360,7 @@
76EB03C218170B33006006FC /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
76EB03C318170B33006006FC /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
7BC01A3B241F40AB00BC7C55 /* LokiPushNotificationService.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = LokiPushNotificationService.appex; sourceTree = BUILT_PRODUCTS_DIR; };
7BC01A3D241F40AB00BC7C55 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = "<group>"; };
7BC01A3D241F40AB00BC7C55 /* NotificationServiceExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationServiceExtension.swift; sourceTree = "<group>"; };
7BC01A3F241F40AB00BC7C55 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7BDCFC0424206E7300641C39 /* LokiPushNotificationService.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = LokiPushNotificationService.entitlements; sourceTree = "<group>"; };
7BDCFC07242186E700641C39 /* NotificationServiceExtensionContext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationServiceExtensionContext.swift; sourceTree = "<group>"; };
@ -2633,7 +2633,7 @@
children = (
7BDCFC07242186E700641C39 /* NotificationServiceExtensionContext.swift */,
7BDCFC0424206E7300641C39 /* LokiPushNotificationService.entitlements */,
7BC01A3D241F40AB00BC7C55 /* NotificationService.swift */,
7BC01A3D241F40AB00BC7C55 /* NotificationServiceExtension.swift */,
7BC01A3F241F40AB00BC7C55 /* Info.plist */,
);
path = LokiPushNotificationService;
@ -3988,7 +3988,7 @@
buildActionMask = 2147483647;
files = (
7BDCFC08242186E700641C39 /* NotificationServiceExtensionContext.swift in Sources */,
7BC01A3E241F40AB00BC7C55 /* NotificationService.swift in Sources */,
7BC01A3E241F40AB00BC7C55 /* NotificationServiceExtension.swift in Sources */,
7BDCFC092421894900641C39 /* MessageFetcherJob.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;