-
Notifications
You must be signed in to change notification settings - Fork 438
[NEW] In-app notifications #1504
[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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
… into local-notifications
…a/Rocket.Chat.iOS into local-notifications
… into local-notifications
… into local-notifications
….Chat.iOS into local-notifications
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I was kinda on the fence about it anyway.
self.view.layoutIfNeeded() | ||
} | ||
|
||
timer = Timer.scheduledTimer(withTimeInterval: notificationVisibleDuration, repeats: false) { _ in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[weak self]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😅
…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/notification
steam.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