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

Add in-app notification for latest changes #7484

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

mojganii
Copy link
Collaborator

@mojganii mojganii commented Jan 20, 2025

This PR adds in-app notification once app is updated. in addition, It shows the changes when user taps whole notification bar.

First Second
Image 2

This change is Reviewable

Copy link

linear bot commented Jan 20, 2025

@mojganii mojganii self-assigned this Jan 20, 2025
@mojganii mojganii added the iOS Issues related to iOS label Jan 20, 2025
Copy link
Contributor

@buggmagnet buggmagnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 19 of 19 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @mojganii)


ios/MullvadVPN/Notifications/Notification Providers/LatestChangesNotificationProvider.swift line 19 at r1 (raw file):

    }

    var isUpdated: Bool {

We should add a comment explaining that the first check is here to make sure we don't show the changelog notifications on new installations. (I'm assuming this is here for that reason, otherwise it would seem redundant)

Also isUpdated sounds good, but I think we can do even better: shouldShowNotification
Since this is only used here, it makes it immediately obvious what we use this for.


ios/MullvadVPN/Notifications/Notification Providers/InApp/LatestChangesInAppNotificationProvider.swift line 11 at r1 (raw file):

import UIKit

class LatestChangesInAppNotificationProvider: NotificationProvider, InAppNotificationProvider, @unchecked Sendable {

This file doesn't seem to be referenced anywhere in Xcode, or the pbx proj file, I'm very confused now at how this works at all.

Given that I've just tested that the feature already works, it looks like we can delete this ?

@mojganii mojganii force-pushed the add-in-app-notification-banner-for-changelog-ios-989 branch from d585dd5 to b5c82f3 Compare January 21, 2025 09:51
Copy link
Collaborator Author

@mojganii mojganii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 14 of 19 files reviewed, 2 unresolved discussions (waiting on @buggmagnet)


ios/MullvadVPN/Notifications/Notification Providers/LatestChangesNotificationProvider.swift line 19 at r1 (raw file):

Previously, buggmagnet wrote…

We should add a comment explaining that the first check is here to make sure we don't show the changelog notifications on new installations. (I'm assuming this is here for that reason, otherwise it would seem redundant)

Also isUpdated sounds good, but I think we can do even better: shouldShowNotification
Since this is only used here, it makes it immediately obvious what we use this for.

Done.


ios/MullvadVPN/Notifications/Notification Providers/InApp/LatestChangesInAppNotificationProvider.swift line 11 at r1 (raw file):

Previously, buggmagnet wrote…

This file doesn't seem to be referenced anywhere in Xcode, or the pbx proj file, I'm very confused now at how this works at all.

Given that I've just tested that the feature already works, it looks like we can delete this ?

fixed. I reset the commit but it seemed Xcode didn't take action properly.

@mojganii mojganii force-pushed the add-in-app-notification-banner-for-changelog-ios-989 branch 2 times, most recently from f63ffdc to 72f8e19 Compare January 21, 2025 10:08
@mojganii mojganii requested a review from buggmagnet January 21, 2025 10:14
@mojganii mojganii force-pushed the add-in-app-notification-banner-for-changelog-ios-989 branch from 72f8e19 to 52b4603 Compare January 21, 2025 16:39
Copy link
Contributor

@rablador rablador left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 13 of 19 files at r1, 5 of 5 files at r2, 2 of 2 files at r3, 6 of 6 files at r4, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @buggmagnet and @mojganii)


ios/MullvadVPN/Coordinators/ChangeLogCoordinator.swift line 24 at r3 (raw file):

    }

    var presentationContext: UIViewController {

If presentationContext should not be needed here, only presentedViewController is necessary to fulfill Presentable protocol.


ios/MullvadVPN/Notifications/Notification Providers/LatestChangesNotificationProvider.swift line 42 at r3 (raw file):

            style: .success,
            title: NSLocalizedString(
                "Latest_Changes_IN_APP_NOTIFICATION_TITLE",

I think we always use all caps for these identifiers.


ios/MullvadVPN/Notifications/Notification Providers/LatestChangesNotificationProvider.swift line 55 at r3 (raw file):

        NSAttributedString(
            markdownString: NSLocalizedString(
                "Latest_Changes_IN_APP_NOTIFICATION_BODY",

I think we always use all caps for these identifiers.

@mojganii mojganii force-pushed the add-in-app-notification-banner-for-changelog-ios-989 branch from 52b4603 to f3b1f41 Compare January 22, 2025 10:11
Copy link
Collaborator Author

@mojganii mojganii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 18 of 22 files reviewed, 5 unresolved discussions (waiting on @buggmagnet and @rablador)


ios/MullvadVPN/Coordinators/ChangeLogCoordinator.swift line 24 at r3 (raw file):

Previously, rablador (Jon Petersson) wrote…

If presentationContext should not be needed here, only presentedViewController is necessary to fulfill Presentable protocol.

that was for adding button to navigation bar. however, I changed that to be managed in coordinator instead.


ios/MullvadVPN/Notifications/Notification Providers/LatestChangesNotificationProvider.swift line 42 at r3 (raw file):

Previously, rablador (Jon Petersson) wrote…

I think we always use all caps for these identifiers.

Good catch.


ios/MullvadVPN/Notifications/Notification Providers/LatestChangesNotificationProvider.swift line 55 at r3 (raw file):

Previously, rablador (Jon Petersson) wrote…

I think we always use all caps for these identifiers.

Done.

@mojganii mojganii requested review from rablador and removed request for SteffenErn and acb-mv January 22, 2025 10:26
buggmagnet
buggmagnet previously approved these changes Jan 22, 2025
Copy link
Contributor

@buggmagnet buggmagnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 5 files at r2, 1 of 2 files at r3, 6 of 6 files at r4, 4 of 4 files at r5, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @rablador)

@mojganii mojganii force-pushed the add-in-app-notification-banner-for-changelog-ios-989 branch from f3b1f41 to 950969d Compare January 22, 2025 12:49
rablador
rablador previously approved these changes Jan 22, 2025
Copy link
Contributor

@rablador rablador left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 4 files at r5, 9 of 9 files at r6, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@mojganii mojganii force-pushed the add-in-app-notification-banner-for-changelog-ios-989 branch from 950969d to 7375a17 Compare January 22, 2025 15:07
@mojganii mojganii force-pushed the add-in-app-notification-banner-for-changelog-ios-989 branch 2 times, most recently from eb21418 to 8ae7970 Compare January 22, 2025 15:20
Copy link
Contributor

@rablador rablador left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 18 of 23 files reviewed, 1 unresolved discussion (waiting on @mojganii)


ios/CHANGELOG.md line 28 at r7 (raw file):

- Broken DAITA settings view on iOS 15.
### Changed
- Moved Changelog to settings and introduced an in-app notification banner to inform users of changes 

Should be "Move changelog [...] and introduce an [...]"

@mojganii mojganii force-pushed the add-in-app-notification-banner-for-changelog-ios-989 branch from 8ae7970 to 04c7549 Compare January 22, 2025 15:27
Copy link
Contributor

@rablador rablador left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5 of 5 files at r8, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @mojganii)

@mojganii mojganii force-pushed the add-in-app-notification-banner-for-changelog-ios-989 branch from 04c7549 to 5f9315b Compare January 22, 2025 15:37
Copy link
Contributor

@rablador rablador left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5 of 5 files at r10, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @mojganii)

Copy link
Contributor

@rablador rablador left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @mojganii)

@rablador rablador merged commit a1b47c2 into main Jan 22, 2025
13 of 14 checks passed
@rablador rablador deleted the add-in-app-notification-banner-for-changelog-ios-989 branch January 22, 2025 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iOS Issues related to iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants