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

MM-53924 - Mobile push notifications #503

Merged
merged 13 commits into from
Sep 6, 2023
Merged

Conversation

cpoile
Copy link
Member

@cpoile cpoile commented Aug 25, 2023

Summary

  • Added mobile push notifications
  • Push notification is sent for all call started posts in DMs and GMs, and if the user receives a notification for regular channels then we pretty-fy that one too. (i.e., we currently do not send out a regular channel push notification for a call start message unless the user has push notifications set for all activity in the channel)

DM Channels:

iOS Android condensed Android expanded
IMG_1206 Screenshot_20230825-172807~2 Screenshot_20230825-172812~2

GM Channels:

iOS Android condensed Android expanded
IMG_1207 Screenshot_20230825-172944~2 Screenshot_20230825-172947~2

Regular Channels (only if the user receives the notification naturally):

iOS Android condensed Android expanded
IMG_1208 Screenshot_20230825-173014~2 Screenshot_20230825-173018~2

You can see that Android does it's own processing of the message on the user's device, so this might look different based on the user's make & model. (See the inline code comment below for an example of this.)

Ticket Link

@cpoile cpoile added 1: UX Review Requires review by ux 2: Dev Review Requires review by a core committer labels Aug 25, 2023

func buildPushNotificationMessage(senderName string) string {
// TODO: translations https://mattermost.atlassian.net/browse/MM-54256
return fmt.Sprintf("\u200b%s is inviting you to a call", senderName)
Copy link
Member Author

Choose a reason for hiding this comment

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

This was kind of funny. For a long time I thought the push notification was being rewritten somewhere because what should have been Sender Name is inviting you to a call was turning into Sender Name: is inviting you to a call in condensed, and

Sender Name
is inviting you to a call

in expanded view.
It turns out that (at least my) Android device does its own processing, and if it notices the prefix of the notification is the same as the sender name, it elides it. Thanks, Android. Super helpful.

@codecov-commenter
Copy link

codecov-commenter commented Aug 26, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.08% ⚠️

Comparison is base (9fdbb65) 5.50% compared to head (2164499) 5.43%.

Additional details and impacted files
@@           Coverage Diff            @@
##            main    #503      +/-   ##
========================================
- Coverage   5.50%   5.43%   -0.08%     
========================================
  Files         23      24       +1     
  Lines       4265    4379     +114     
========================================
+ Hits         235     238       +3     
- Misses      4012    4124     +112     
+ Partials      18      17       -1     
Files Changed Coverage Δ
server/bot_api.go 0.00% <0.00%> (ø)
server/plugin.go 0.00% <0.00%> (ø)
server/push_notifications.go 0.00% <0.00%> (ø)
server/store.go 0.00% <ø> (ø)
server/utils.go 26.85% <0.00%> (-8.52%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@streamer45 streamer45 left a comment

Choose a reason for hiding this comment

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

Nice! Gave this a first quick pass and left some minor comments.

cpoile added 3 commits August 29, 2023 09:34
# Conflicts:
#	go.mod
#	go.sum
#	server/plugin.go
#	server/utils.go
@matthewbirtch
Copy link
Contributor

@cpoile for the Android expanded notification state, do we have any control over the Okay button? Wondering if it should be 'Join call'? 'Okay' doesn't seem particularly useful and I'm not sure what it would do
image

@streamer45 streamer45 self-requested a review August 30, 2023 19:49
Copy link
Collaborator

@streamer45 streamer45 left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@streamer45 streamer45 removed the 2: Dev Review Requires review by a core committer label Aug 31, 2023
@streamer45 streamer45 added this to the v0.19.0 - MM 9.0 milestone Aug 31, 2023
@cpoile
Copy link
Member Author

cpoile commented Sep 5, 2023

@matthewbirtch Making a custom button will take some native work, so I think we've got to prioritize it as new effort. Sound good?

@matthewbirtch
Copy link
Contributor

@matthewbirtch Making a custom button will take some native work, so I think we've got to prioritize it as new effort. Sound good?

no problem, can we just hide the Okay button at all?

@cpoile
Copy link
Member Author

cpoile commented Sep 6, 2023

@matthewbirtch Making a custom button will take some native work, so I think we've got to prioritize it as new effort. Sound good?

no problem, can we just hide the Okay button at all?

@matthewbirtch Edit: I'm looking into it, maybe it is in our native code...

@cpoile
Copy link
Member Author

cpoile commented Sep 6, 2023

@matthewbirtch Ok, I think I figured out Android at least. It's our own native code that gives the Okay button. Will be fixed once mattermost/mattermost-push-proxy#106 and mattermost/mattermost-mobile#7534 roll out.
We don't have that problem with iOS -- there won't be a way to reply to our Calls notifications. You have to tap the notification, which will bring you to the channel.

@matthewbirtch
Copy link
Contributor

@matthewbirtch Ok, I think I figured out Android at least. It's our own native code that gives the Okay button. Will be fixed once mattermost/mattermost-push-proxy#106 and mattermost/mattermost-mobile#7534 roll out. We don't have that problem with iOS -- there won't be a way to reply to our Calls notifications. You have to tap the notification, which will bring you to the channel.

Okay, thanks for investigating @cpoile. I think I'm good to approve this then

@matthewbirtch matthewbirtch removed the 1: UX Review Requires review by ux label Sep 6, 2023
@cpoile cpoile merged commit eaf3383 into main Sep 6, 2023
@cpoile cpoile deleted the MM-53924-mobile-push-notifications branch September 6, 2023 21:20
@cpoile cpoile added the 3: Reviews Complete All reviewers have approved the pull request label Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants