[NEW] In-app notifications#1504
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1504 +/- ##
===========================================
+ Coverage 34.15% 36.54% +2.39%
===========================================
Files 268 277 +9
Lines 12726 12896 +170
===========================================
+ Hits 4346 4713 +367
+ Misses 8380 8183 -197
Continue to review full report at Codecov.
|
| func testDirectMessageNotificationDecoding() { | ||
| let notificationJson = | ||
| """ | ||
| { |
There was a problem hiding this comment.
Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
| func testChannelNotificationDecoding() { | ||
| let notificationJson = | ||
| """ | ||
| { |
There was a problem hiding this comment.
Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
| body: "Hey!", | ||
| rid: "UUUUUUUU" | ||
| ) | ||
|
|
There was a problem hiding this comment.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
| static func post(notification: ChatNotification) { | ||
| guard AppManager.currentRoomId != notification.payload.rid else { return } | ||
| guard !notification.title.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty else { return } | ||
| guard !notification.body.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty else { return } |
There was a problem hiding this comment.
We're trying to follow this pattern across the project when we have multiple guards:
guard
...,
...
else {
...
return
}….Chat.iOS into local-notifications
rafaelks
left a comment
There was a problem hiding this comment.
First of all, the result of this PR is looking very good @Sameesunkaria! But, I was able to receive notifications with the app opened. Can we disable the notifications when the app is opened and the WebSocket is connected?
| guard let notificationView = notificationView else { return } | ||
|
|
||
| notificationView.displayNotification(title: title, body: body, username: username) | ||
| playSound() |
There was a problem hiding this comment.
What do you think about not playing any sound for now? Until we have a setting for that, I would with no sound. Let's just comment the code maybe :-)
There was a problem hiding this comment.
Sure. I was kinda on the fence about it anyway.
| self.view.layoutIfNeeded() | ||
| } | ||
|
|
||
| timer = Timer.scheduledTimer(withTimeInterval: notificationVisibleDuration, repeats: false) { _ in |
…cket is connected
|
@rafaelks You'll have to test the outcome with your dev profile. I am not able to get my APNS cert to work with RC. |
….Chat.iOS into local-notifications
…local-notifications
|
Looking amazing @Sameesunkaria!!! Thank you! 👏 |

@RocketChat/ios
This PR adds the functionality of displaying in-app notifications. The notifications are delivered based on the
stream-notify-user/notificationsteam.Component checklist
Issues to address separately (Server-Side)
"sound" : "chime.mp3"key should be added to the APS request on the server. This will make the push notifications sound similar to the in-app and desktop notifications.Closes #1125
Closes #1339