Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showing the iOS default silhoutte when the user/room avatar is missing #965

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ElementX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -4252,6 +4252,7 @@
);
MARKETING_VERSION = "$(MARKETING_VERSION)";
PRODUCT_BUNDLE_IDENTIFIER = "${BASE_BUNDLE_IDENTIFIER}.nse";
PRODUCT_DISPLAY_NAME = "$(APP_NAME)";
PRODUCT_NAME = NSE;
SDKROOT = iphoneos;
SWIFT_OBJC_INTERFACE_HEADER_NAME = "GeneratedInterface-Swift.h";
Expand All @@ -4274,7 +4275,7 @@
);
MARKETING_VERSION = "$(MARKETING_VERSION)";
PRODUCT_BUNDLE_IDENTIFIER = "$(BASE_BUNDLE_IDENTIFIER)";
PRODUCT_NAME = ElementX;
PRODUCT_NAME = "$(APP_NAME)";
SDKROOT = iphoneos;
SWIFT_OBJC_BRIDGING_HEADER = "ElementX/SupportingFiles/ElementX-Bridging-Header.h";
SWIFT_OBJC_INTERFACE_HEADER_NAME = "GeneratedInterface-Swift.h";
Expand All @@ -4297,7 +4298,7 @@
);
MARKETING_VERSION = "$(MARKETING_VERSION)";
PRODUCT_BUNDLE_IDENTIFIER = "$(BASE_BUNDLE_IDENTIFIER)";
PRODUCT_NAME = ElementX;
PRODUCT_NAME = "$(APP_NAME)";
SDKROOT = iphoneos;
SWIFT_OBJC_BRIDGING_HEADER = "ElementX/SupportingFiles/ElementX-Bridging-Header.h";
SWIFT_OBJC_INTERFACE_HEADER_NAME = "GeneratedInterface-Swift.h";
Expand Down Expand Up @@ -4328,6 +4329,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
APP_GROUP_IDENTIFIER = "group.$(BASE_APP_GROUP_IDENTIFIER)";
APP_NAME = ElementX;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = Colors/AccentColor;
BASE_APP_GROUP_IDENTIFIER = io.element;
BASE_BUNDLE_IDENTIFIER = io.element.elementx;
Expand Down Expand Up @@ -4395,6 +4397,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
APP_GROUP_IDENTIFIER = "group.$(BASE_APP_GROUP_IDENTIFIER)";
APP_NAME = ElementX;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = Colors/AccentColor;
BASE_APP_GROUP_IDENTIFIER = io.element;
BASE_BUNDLE_IDENTIFIER = io.element.elementx;
Expand Down Expand Up @@ -4532,6 +4535,7 @@
);
MARKETING_VERSION = "$(MARKETING_VERSION)";
PRODUCT_BUNDLE_IDENTIFIER = "${BASE_BUNDLE_IDENTIFIER}.nse";
PRODUCT_DISPLAY_NAME = "$(APP_NAME)";
PRODUCT_NAME = NSE;
SDKROOT = iphoneos;
SWIFT_OBJC_INTERFACE_HEADER_NAME = "GeneratedInterface-Swift.h";
Expand Down
2 changes: 1 addition & 1 deletion ElementX/Sources/Application/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,
}

func shouldDisplayInAppNotification(_ service: NotificationManagerProtocol, content: UNNotificationContent) -> Bool {
guard let roomId = content.userInfo[NotificationConstants.UserInfoKey.roomIdentifier] as? String else {
guard let roomId = content.roomID else {
return true
}
guard let userSessionFlowCoordinator else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ extension UNMutableNotificationContent {
senderID: String,
senderName: String,
iconType: NotificationIconType) async throws -> UNMutableNotificationContent {
var image: INImage?
var image = INImage(named: "")
Velin92 marked this conversation as resolved.
Show resolved Hide resolved
if let mediaSource = iconType.mediaSource {
switch await mediaProvider?.loadImageDataFromSource(mediaSource) {
case .success(let data):
Expand Down Expand Up @@ -161,7 +161,7 @@ extension UNMutableNotificationContent {
serviceName: nil,
sender: sender,
attachments: nil)
if speakableGroupName != nil, let image {
if speakableGroupName != nil {
intent.setImage(image, forParameterNamed: \.speakableGroupName)
}

Expand Down
2 changes: 1 addition & 1 deletion ElementX/SupportingFiles/target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ targets:

settings:
base:
PRODUCT_NAME: ElementX
PRODUCT_NAME: $(APP_NAME)
PRODUCT_BUNDLE_IDENTIFIER: $(BASE_BUNDLE_IDENTIFIER)
MARKETING_VERSION: $(MARKETING_VERSION)
CURRENT_PROJECT_VERSION: $(CURRENT_PROJECT_VERSION)
Expand Down
2 changes: 1 addition & 1 deletion NSE/SupportingFiles/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>$(PRODUCT_NAME)</string>
<string>$(PRODUCT_DISPLAY_NAME)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
Expand Down
3 changes: 2 additions & 1 deletion NSE/SupportingFiles/target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ targets:
info:
path: ../SupportingFiles/Info.plist
properties:
CFBundleDisplayName: $(PRODUCT_NAME)
CFBundleDisplayName: $(PRODUCT_DISPLAY_NAME)
CFBundleShortVersionString: $(MARKETING_VERSION)
CFBundleVersion: $(CURRENT_PROJECT_VERSION)
appGroupIdentifier: $(APP_GROUP_IDENTIFIER)
Expand All @@ -53,6 +53,7 @@ targets:
settings:
base:
PRODUCT_NAME: NSE
PRODUCT_DISPLAY_NAME: $(APP_NAME)
PRODUCT_BUNDLE_IDENTIFIER: ${BASE_BUNDLE_IDENTIFIER}.nse
MARKETING_VERSION: $(MARKETING_VERSION)
CURRENT_PROJECT_VERSION: $(CURRENT_PROJECT_VERSION)
Expand Down
1 change: 1 addition & 0 deletions changelog.d/pr-965.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Showing the iOS default contact/group silhouette in notifications when the avatar is missing.
1 change: 1 addition & 0 deletions project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ settings:
BASE_APP_GROUP_IDENTIFIER: io.element
APP_GROUP_IDENTIFIER: group.$(BASE_APP_GROUP_IDENTIFIER)
BASE_BUNDLE_IDENTIFIER: io.element.elementx
APP_NAME: ElementX
KEYCHAIN_ACCESS_GROUP_IDENTIFIER: $(AppIdentifierPrefix)$(BASE_BUNDLE_IDENTIFIER)
MARKETING_VERSION: 1.1.2
CURRENT_PROJECT_VERSION: 1
Expand Down